Skip to content

Commit

Permalink
feat(workflow): add tag extraction and conditional tagging for workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhen-Bo committed Feb 4, 2025
1 parent d5e96ea commit 34e17e4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/docker-publish-public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.AUTH_TOKEN }}

- name: Extract tag name
id: get_tag
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=tag
type=raw,value=latest
type=raw,value=latest,enable=${{ !contains(steps.get_tag.outputs.TAG_NAME, 'staging') && !contains(steps.get_tag.outputs.TAG_NAME, 'test') }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
Expand Down

0 comments on commit 34e17e4

Please sign in to comment.