Skip to content

Commit

Permalink
fix: better workflow vars for branch
Browse files Browse the repository at this point in the history
  • Loading branch information
voodooGQ committed Feb 6, 2024
1 parent 59846fc commit e239440
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/release-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ jobs:
name: Release and Deploy
runs-on: ubuntu-latest
steps:
# Envs based on the current branch
- name: Branch Env
id: branch_env
run: |
echo "Running on branch "
if [ "${{ github.ref }}" == "refs/heads/develop" ]; then
echo "postfix=staging" >> $GITHUB_ENV
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
echo "postfix=production" >> $GITHUB_ENV
else
echo "postfix=staging" >> $GITHUB_ENV
# # Setup Auth token to push to github packages
- name: Set NPM Config
Expand Down Expand Up @@ -73,6 +84,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

# Docs Site
- name: Build and push docs site
uses: docker/build-push-action@v2
env:
Expand All @@ -86,8 +98,9 @@ jobs:
context: ./docs
push: true
tags: |
${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_SAGE_DOCS }}:${{ steps.gitsha.outputs.value }}-release-${{ github.ref == "refs/heads/main" && 'production' || 'staging' }}
${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_SAGE_DOCS }}:${{ steps.gitsha.outputs.value }}-release-${{ env.postfix }}
# Storybook Site
- name: Build and push storybook
uses: docker/build-push-action@v2
env:
Expand All @@ -101,8 +114,9 @@ jobs:
context: ./packages/sage-react/
push: true
tags: |
${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_SAGE_STORYBOOK }}:${{ steps.gitsha.outputs.value }}-release-${{ github.ref == "refs/heads/main" && 'production' || 'staging' }}
${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_SAGE_STORYBOOK }}:${{ steps.gitsha.outputs.value }}-release-${{ env.postfix }}
# Sassdocs Site
- name: Build and push sassdocs
uses: docker/build-push-action@v2
env:
Expand All @@ -116,4 +130,4 @@ jobs:
context: ./packages/sage-assets/
push: true
tags: |
${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_SAGE_SASSDOCS }}:${{ steps.gitsha.outputs.value }}-release-${{ github.ref == "refs/heads/main" && 'production' || 'staging' }}
${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_SAGE_SASSDOCS }}:${{ steps.gitsha.outputs.value }}-release-${{ env.postfix }}

0 comments on commit e239440

Please sign in to comment.