From d993bc76bd1e259870d50977c9866565e8e04fee Mon Sep 17 00:00:00 2001 From: Parul Date: Wed, 7 Feb 2024 11:42:42 -0800 Subject: [PATCH] Docker-build tags for version for current branch --- .github/workflows/docker-build.yml | 13 +++++++++++-- .github/workflows/lint.yml | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 2020f60..3ee46b3 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -18,12 +18,21 @@ jobs: uses: docker/metadata-action@v5 with: images: ghcr.io/cityofkamloops/filepass + tags: | + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} + # output 0.1.2 + type=semver,pattern={{version}} + # output 0.1 + type=semver,pattern={{major}}.{{minor}} + # disabled if major zero + type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -34,4 +43,4 @@ jobs: context: . platforms: linux/amd64 push: true - tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 98b2a66..b04fb15 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,4 +7,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: psf/black@stable \ No newline at end of file + - uses: psf/black@stable