diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 841f7dc..441454f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,8 @@ name: CI on: push: branches: [main] + tags: + - "*" pull_request: schedule: - cron: "0 0 * * *" @@ -34,22 +36,15 @@ jobs: - uses: actions/checkout@v6 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@v6 - with: - images: ghcr.io/${{ env.IMAGE_NAME }},docker.io/${{ env.IMAGE_NAME }} - tags: type=sha,prefix= - flavor: latest=true - name: Build uses: docker/build-push-action@v7 with: context: . platforms: linux/amd64, linux/arm64, linux/arm - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max + build-args: | + VERSION=${{ github.sha }} test: runs-on: ubuntu-latest @@ -98,7 +93,10 @@ jobs: uses: docker/metadata-action@v6 with: images: ghcr.io/${{ env.IMAGE_NAME }},docker.io/${{ env.IMAGE_NAME }} - tags: type=sha,prefix= + tags: | + type=sha,prefix= + type=ref,event=tag + type=raw,value=latest,enable={{is_default_branch}} flavor: latest=true - name: Build and push id: push