Skip to content

Commit 2c046b0

Browse files
committed
Bring across tag logic from #135 and update readme to include this information
Signed-off-by: Adam Warner <[email protected]>
1 parent 27196cd commit 2c046b0

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

.github/workflows/ftl-build.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- '**'
88
pull_request:
99
workflow_dispatch:
10+
release:
11+
types: [published]
1012
schedule:
1113
# 1:30am UTC every Sunday, has no particular significance
1214
- cron: "30 1 * * 0"
@@ -25,6 +27,7 @@ jobs:
2527
|| (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
2628
|| github.event_name == 'workflow_dispatch'
2729
|| github.event_name == 'schedule'
30+
|| github.event_name == 'release'
2831
2932
outputs:
3033
DO_DEPLOY: ${{ steps.variables.outputs.DO_DEPLOY }}
@@ -88,12 +91,14 @@ jobs:
8891
${{ needs.smoke-tests.outputs.DOCKER_REGISTRY_IMAGE }}
8992
${{ needs.smoke-tests.outputs.GITHUB_REGISTRY_IMAGE }}
9093
# meta-tags:
91-
# type=schedule means that a tag is applied when the workflow is triggered by a schedule event
92-
# type=ref,event=branch means that a tag is applied when the workflow is triggered by a push to a branch
94+
# type=schedule, pattern=nightly means that a "nightly" tag is applied when the workflow is triggered by a schedule event
95+
# type=raw,value=nightly means that a "nightly" tag is applied when the workflow is triggerd by a push to a branch (enabled only for master branch to avoid tagging every push to other branches with "nightly")
96+
# type=ref,event=branch means that a tag is applied when the workflow is triggered by a push to a branch (enabled only for non-master branches to avoid tagging every push to master branch with the branch name)
9397
# type=ref,event=tag means that a tag is applied when the workflow is triggered by a push to a tag
9498
meta-tags: |
95-
type=schedule,enable=${{ github.event_name == 'schedule' }}
96-
type=ref,event=branch,enable=${{ github.event_name != 'schedule' }}
99+
type=schedule,pattern=nightly
100+
type=raw,value=nightly,enable=${{ github.ref == 'refs/heads/master' }}
101+
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master' }}
97102
type=ref,event=tag
98103
meta-flavor: |
99104
latest=${{ startsWith(github.ref, 'refs/tags/') }}

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ All images are pushed to both Docker Hub (`pihole/ftl-build`) and GHCR (`ghcr.io
1616
## How does it get uploaded?
1717

1818
- GitHub Actions (`ftl-build.yml`):
19-
- Every `pull_request` event triggers a build (but does not push)
20-
- Every `workflow_dispatch` event triggers a build of the branch it is run against, and uploads a branch-based tag
21-
- Every `tag` event (e.g `v1`) triggers a build and uploads both `${{matrix.ARCH}}` and `v1-${{matrix.ARCH}}` tags
22-
- Schedule: 1:30am UTC every Sunday a build is triggered and a `${{matrix.ARCH}}` tag is uploaded
19+
- Every `pull_request` event triggers a test build (does not push)
20+
- Every branch `push` (except `master`) publishes the branch name as a tag
21+
- Every `workflow_dispatch` event triggers a build of the branch it is run against, and publishes the branch name as a tag
22+
- Every push to `master` publishes the `nightly` tag
23+
- Schedule: 1:30am UTC every Sunday a build is triggered and the `nightly` tag is published
24+
- Every published GitHub `release` (e.g. `v1`) publishes the release tag and `latest`

0 commit comments

Comments
 (0)