Skip to content

Commit

Permalink
Merge pull request #491 from 3dgeo-heidelberg/fixup-docker-workflow
Browse files Browse the repository at this point in the history
Avoid using bash env vars in GitHub actions parameters
  • Loading branch information
han16nah authored Dec 12, 2024
2 parents 38a400a + 0861827 commit 04bc418
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,24 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract tag name
- name: Build Docker image
uses: docker/build-push-action@v6
if: github.event_name == 'workflow_dispatch'
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/helios:${{ github.event.inputs.version }}

- name: Set tag as output
if: github.event_name == 'push'
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
run: echo "tag=${GITHUB_REF##*/}" >> "$GITHUB_ENV"

- name: Extract tag name
if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=${{ github.event.inputs.version }}" >> $GITHUB_ENV


- name: Build Docker image
uses: docker/build-push-action@v6
if: github.event_name == 'push'
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/helios:$TAG_NAME
tags: ${{ secrets.DOCKER_USERNAME }}/helios:${{ env.tag }}

0 comments on commit 04bc418

Please sign in to comment.