Skip to content

Commit

Permalink
👷 Differentiate between Git branches and tags for Docker tags
Browse files Browse the repository at this point in the history
  • Loading branch information
shnizzedy committed Jun 30, 2022
1 parent 16f4781 commit 12c4f74
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build_C-PAC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set tag & Dockerfile
if: github.ref_type == 'branch'
run: |
if [[ "${{ inputs.variant }}" != "" ]]
then
Expand Down Expand Up @@ -66,6 +67,24 @@ jobs:
echo DOCKER_TAG=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]'):$TAG >> $GITHUB_ENV
echo DOCKERFILE="${DOCKERFILE}" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Set tag & Dockerfile
if: github.ref_type == 'tag'
run: |
if [[ "${{ inputs.variant }}" != "" ]]
then
VARIANT=-${{ inputs.variant }}
fi
TAG=latest
if [[ $VARIANT == "" ]]
then
DOCKERFILE=Dockerfile
else
DOCKERFILE=variant$VARIANT.Dockerfile
fi
TAG=$TAG$VARIANT
echo DOCKER_TAG=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]'):$TAG >> $GITHUB_ENV
echo DOCKERFILE="${DOCKERFILE}" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Prep Dockerfiles for forked repository
if: ${{ github.repository_owner }} != 'FCP-INDI'
run: .github/scripts/local_ghcr $DOCKERFILE ${{ github.repository_owner }} $DOCKER_TAG
Expand Down

0 comments on commit 12c4f74

Please sign in to comment.