Skip to content

Commit

Permalink
ci: change routine to get tag name on docker workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tamada committed Jun 16, 2022
1 parent 25d45f1 commit d21442e
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- uses: actions-ecosystem/action-release-label@v1
id: release-label
if: ${{ github.event.pull_request.merged == true }}

- name: Get latest tag name
uses: actions-ecosystem/action-get-latest-tag@v1
id: latest-tag
if: ${{ steps.release-label.outputs.level != null }}

- name: Git Tag name
id: vars
run: |
HEAD_REF=${{ github.head_ref }}
echo "::set-output name=tag::${HEAD_REF##*/v}"
tag=$(git tag --sort version:refname | tail -1 | sed 's/v\([0-9.]*\)/\1/)'
echo "::set-output name=tag::${tag#v}"
# docker image
- name: Docker Buildx
Expand All @@ -45,6 +36,6 @@ jobs:
with:
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/btmeister:${{ steps.latest-tag.outputs.tag }}
ghcr.io/${{ github.repository_owner }}/btmeister:${{ steps.vars.outputs.tag }}
ghcr.io/${{ github.repository_owner }}/btmeister:latest

0 comments on commit d21442e

Please sign in to comment.