Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions .github/workflows/ci-cd-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,17 @@ jobs:
- name: Check if perform release
id: perform_release
run: |
if [[ "${GITHUB_REF}" == "refs/heads/main" || "${GITHUB_REF}" == "refs/heads/develop" || "${GITHUB_REF}" == "refs/heads/aks-dev" ]]; then
echo "PERFORM_RELEASE=true" >> $GITHUB_ENV
if [[ "${{ github.ref_name }}" == "${{ github.event.repository.default_branch }}" || "${{ github.ref_name }}" == "development" || "${{ github.ref_name }}" == "aks-dev" ]]; then
PERFORM_RELEASE=true
elif [[ "${GITHUB_EVENT_NAME}" == "push" && ( "${GITHUB_REF}" == "refs/heads/main" || "${GITHUB_REF}" == refs/tags/* ) ]]; then
echo "PERFORM_RELEASE=true" >> $GITHUB_ENV
PERFORM_RELEASE=true
elif [[ "${{ inputs.performRelease }}" == "true" ]]; then
echo "PERFORM_RELEASE=true" >> $GITHUB_ENV
PERFORM_RELEASE=true
else
echo "PERFORM_RELEASE=false" >> $GITHUB_ENV
PERFORM_RELEASE=false
fi
echo "Perform release condition: PERFORM_RELEASE"
echo "PERFORM_RELEASE=$PERFORM_RELEASE" >> $GITHUB_ENV
echo "Perform release: $PERFORM_RELEASE"

- name: Lowercase Docker Image Name
run: |
Expand All @@ -90,7 +91,8 @@ jobs:
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=edge,branch=main
type=raw,value=prod,enable={{is_default_branch}}
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/development' }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
Expand Down Expand Up @@ -120,6 +122,12 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Debug metadata outputs
if: env.PERFORM_RELEASE == 'true'
run: |
echo "Meta tags: ${{ steps.meta.outputs.tags }}"
echo "Meta labels: ${{ steps.meta.outputs.labels }}"
echo "IMAGE_NAME: ${{ env.IMAGE_NAME }}"

- name: Build and push
if: env.PERFORM_RELEASE == 'true'
Expand All @@ -128,5 +136,5 @@ jobs:
context: .
push: true
target: "${{ env.PRODUCTION_STAGE }}"
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}