Skip to content

bye.

bye. #42

Workflow file for this run

name: πŸš€ Deploy
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: write
contents: read
id-token: write
jobs:
deploy:
name: πŸš€ Deploy
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: βŽ” Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: 🟧 Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- name: 🀝 Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-duration-seconds: 900
- name: πŸš€ Deploy PR Preview
if: github.event_name == 'pull_request'
run: |
pnpm sst deploy --stage pr${{ github.event.number }}
env:
AWS_DOMAIN: ${{ secrets.AWS_DOMAIN }}
AWS_CERTIFICATE_ARN: ${{ secrets.AWS_CERTIFICATE_ARN }}
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_REPORT_URL: ${{ secrets.SENTRY_REPORT_URL }}
- name: πŸš€ Deploy Production
if: ${{ github.ref == 'refs/heads/main' }}
run: |
pnpm sst deploy --stage prod
env:
AWS_DOMAIN: ${{ secrets.AWS_DOMAIN }}
AWS_CERTIFICATE_ARN: ${{ secrets.AWS_CERTIFICATE_ARN }}
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_REPORT_URL: ${{ secrets.SENTRY_REPORT_URL }}
- name: ♻️ Purge Cloudfront cache
if: ${{ github.ref == 'refs/heads/main' }}
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/*"
- name: ♻️ Purge Cloudflare cache
if: ${{ github.ref == 'refs/heads/main' }}
uses: jakejarvis/cloudflare-purge-action@v0.3.0
env:
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
PURGE_URLS: '["https://${{ secrets.AWS_DOMAIN }}", "https://${{ secrets.AWS_DOMAIN }}/resume", "https://${{ secrets.AWS_DOMAIN }}/resume.pdf"]'