From 6ea94f368567ed26c71d6bf04c6a06ea03d57871 Mon Sep 17 00:00:00 2001 From: niklhut <49069026+niklhut@users.noreply.github.com> Date: Fri, 3 Nov 2023 16:28:07 +0100 Subject: [PATCH 1/3] Add support for latest tag --- .github/workflows/docker-img.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker-img.yml b/.github/workflows/docker-img.yml index 43d1317..373bcfa 100644 --- a/.github/workflows/docker-img.yml +++ b/.github/workflows/docker-img.yml @@ -40,6 +40,8 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ github.repository }} + flavor: | + latest=true tags: | type=ref,event=branch type=semver,pattern={{version}} From f5a2a78958a17d096edc9fa097fa99f5ddfa1a3d Mon Sep 17 00:00:00 2001 From: niklhut <49069026+niklhut@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:38:10 +0100 Subject: [PATCH 2/3] Add support for tagging pull requests --- .github/workflows/docker-img.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-img.yml b/.github/workflows/docker-img.yml index 373bcfa..a6e9bda 100644 --- a/.github/workflows/docker-img.yml +++ b/.github/workflows/docker-img.yml @@ -8,6 +8,10 @@ on: branches: - main - master + pull_request: + branches: + - main + - master env: REGISTRY: ghcr.io @@ -41,13 +45,19 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ github.repository }} flavor: | - latest=true + # don't set latest flavor since it is handled by the raw latest tag + latest=false tags: | + # set tags for pushes to branches type=ref,event=branch + # set tags for pull requests + type=ref,event=pr + # set tags for releases type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - + type=semver,pattern={{major}} + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} - name: Build and push Docker image uses: docker/build-push-action@v4 with: From 3aaabf41af818c25bda9b3b79977a0ffd01651d6 Mon Sep 17 00:00:00 2001 From: niklhut <49069026+niklhut@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:38:32 +0100 Subject: [PATCH 3/3] Remove dedicated build action --- .github/workflows/build.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index a58d041..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build - -# Controls when the workflow will run -on: - # Triggers the workflow on push events for all branches - push: - pull_request: - branches: - - main - - master - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # 1. Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Set up Git repository - uses: actions/checkout@v3 - - # 2. Test build using docker-compose - - name: Test build - run: docker compose build --no-cache