Skip to content

Commit

Permalink
Compute tags in prior step
Browse files Browse the repository at this point in the history
  • Loading branch information
Lissy93 committed May 28, 2023
1 parent 63955d5 commit a0d99a2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Compute tags
id: compute-tags
run: |
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
echo "GHCR_TAG=${GHCR_REGISTRY}/${DOCKER_USER}/${IMAGE_NAME}:latest" >> $GITHUB_ENV
echo "DOCKERHUB_TAG=${DOCKERHUB_REGISTRY}/${DOCKER_USER}/${IMAGE_NAME}:latest" >> $GITHUB_ENV
else
echo "GHCR_TAG=${GHCR_REGISTRY}/${DOCKER_USER}/${IMAGE_NAME}:${GIT_TAG}" >> $GITHUB_ENV
echo "DOCKERHUB_TAG=${DOCKERHUB_REGISTRY}/${DOCKER_USER}/${IMAGE_NAME}:${GIT_TAG}" >> $GITHUB_ENV
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
Expand Down

0 comments on commit a0d99a2

Please sign in to comment.