Skip to content

Setup staging env

Setup staging env #1

name: Deploy Designer Decisions (Staging)
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
deploy-staging:
runs-on: ubuntu-latest
environment:
name: staging
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.10.0'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_DEPLOY_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEPLOY_KEY_SECRET }}
aws-region: ${{ vars.AWS_DEFAULT_REGION }}
- name: Install root dependencies
run: npm ci
- name: Build root project
run: npm run ci
- name: Build application
run: npm run pre-deploy:staging --prefix packages/docs/designer-docs/
- name: Deploy to S3
run: |
aws s3 sync --delete ./packages/docs/designer-docs/dist/ s3://${{ vars.BUCKET_NAME }}/staging/pr-${{ github.event.pull_request.number }}
- name: Create CloudFront invalidation
run: aws cloudfront create-invalidation --distribution-id ${{ vars.DISTRIBUTION_ID }} --paths "/*"