Skip to content

v1.3.0

v1.3.0 #15

Workflow file for this run

name: Deploy Workflow
on:
release:
types: [published]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
# permissions required to use aws-actions/configure-aws-credentials
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install Dependencies
run: npm ci --include=dev
- name: Build
env:
VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
VITE_SENTRY_CI_RELEASE_NAME: ${{ github.event.release.name }}
VITE_STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_TEST_PUBLISHABLE_KEY }}
run: |
if [ "${{ github.event.release.prerelease }}" == 'true' ]; then
npm run build:staging
else
npm run build
fi
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.S3_OIDC_GITHUB_ROLE_ARN }}
aws-region: ${{ secrets.S3_BUCKET_REGION }}
- name: Upload to S3
run: |
if [ "${{ github.event.release.prerelease }}" == 'true' ]; then
bucket_dir='staging'
else
bucket_dir='production'
fi
aws s3 sync ./dist \
s3://${{ secrets.S3_BUCKET_NAME }}/$bucket_dir \
--acl bucket-owner-full-control \
--sse AES256 \
--delete
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CLOUDFRONT_OIDC_GITHUB_ROLE_ARN }}
aws-region: ${{ secrets.CLOUDFRONT_DIST_REGION }}
- name: Invalidate CloudFront Edge-Cache
run: |
if [ "${{ github.event.release.prerelease }}" == 'true' ]; then
cf_dist_id=${{ secrets.CLOUDFRONT_STAGING_DIST_ID }}
else
cf_dist_id=${{ secrets.CLOUDFRONT_PROD_DIST_ID }}
fi
aws cloudfront create-invalidation \
--distribution-id $cf_dist_id \
--paths '/*'