Skip to content

Commit

Permalink
feat(workflow): add enable-custom-tags input to be able to publish ta…
Browse files Browse the repository at this point in the history
…gs that are not latest
  • Loading branch information
abrl91 committed May 9, 2024
1 parent 695d017 commit f8efc2a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/release.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ on:
type: string
description: Nx projects configured with deploy affected by the changes
required: true
enable-custom-tags:
type: boolean
description: Enable custom tags for docker images
required: false
default: false
secrets:
NX_CLOUD_ACCESS_TOKEN:
required: true
Expand All @@ -41,6 +46,7 @@ on:
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
BRANCH: ${{ inputs.branch }}
ENABLE_CUSTOM_TAGS: ${{ inputs.enable-custom-tags }}

jobs:
package-container:
Expand Down Expand Up @@ -101,7 +107,9 @@ jobs:
type=ref,event=tag,prefix=tag-
type=raw,value=${{ github.run_id }},prefix=gh-
type=raw,value=${{ env.BRANCH }}
type=raw,value=latest,enable=${{ env.BRANCH == 'master' }}
type=raw,value=latest,enable=${{ env.BRANCH == github.event.repository.default_branch }}
type=raw,value=next,enable=${{ env.ENABLE_CUSTOM_TAGS }}
type=raw,value=master,enable=${{ env.ENABLE_CUSTOM_TAGS }}
# https://www.npmjs.com/package/@nx-tools/nx-docker
- name: Dockerize
Expand All @@ -124,7 +132,7 @@ jobs:
if [[ "${{ env.BRANCH }}" == "next" ]];
then
echo environment="sandbox" >> $GITHUB_OUTPUT
elif [[ "${{ env.BRANCH }}" == "master" ]];
elif [[ "${{ env.BRANCH }}" == github.event.repository.default_branch ]];
then
echo environment="staging" >> $GITHUB_OUTPUT
fi;
Expand Down

0 comments on commit f8efc2a

Please sign in to comment.