Skip to content

Staging Build

Staging Build #354

Workflow file for this run

name: Staging Build
on:
workflow_run:
workflows: ['CI']
branches: ['develop']
types:
- completed
jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: develop
fetch-depth: 0
- name: Prepare Deploy
uses: ./.github/actions/prepare-deploy
with:
main-branch-name: develop
app-configuration: staging
nx-command: run-many
build-compodoc: false
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Deploy to S3
run: |
aws s3 sync --delete deploy/apps/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}/ui--staging/
aws s3 sync deploy/storybook/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}/ui--staging/storybook/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/ui--staging/*"
- name: Publish
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: deploy
publish_branch: staging
commit_message: 'Staging deploy -- ${{ github.event.head_commit.message }}'