Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kriipke authored Mar 19, 2024
1 parent 644b032 commit 5d07930
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
Expand All @@ -43,27 +48,14 @@ jobs:
type=semver,pattern={{version}}
type=raw,value={{branch}}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
- name: debug vars
run: echo HEADREF Dockerfile.${{ github.head_ref }}
- name: debug vars
run: echo HEADREF Dockerfile.${{ github.ref }}
- name: debug vars
run: echo HEADREF Dockerfile.$GITHUB_METADATA_OUTPUT_TAGS



- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./docker
file: ./docker/Dockerfile.${{ github.head_ref }}
file: ./docker/Dockerfile.${{ steps.extract_branch.outputs.branch }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64


- name: debug vars
run: echo HEADREF Dockerfile.${{ github.ref }}

0 comments on commit 5d07930

Please sign in to comment.