Skip to content

Commit

Permalink
triger action by push tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jneeee committed Mar 29, 2024
1 parent cff7aa2 commit 6669bba
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build and Push Docker image

on:
push:
branches:
- master
tags:
- 'v*'

jobs:
build-and-push:
Expand All @@ -26,15 +26,11 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get the version tag
id: get_version
run: echo "::set-output name=VERSION::$(git describe --tags --abbrev=0)"

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:${{ steps.get_version.outputs.VERSION }}
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
build-args: GIT_REVISION=$(git rev-parse HEAD)

0 comments on commit 6669bba

Please sign in to comment.