Skip to content

chore: deploy to AWS #1

chore: deploy to AWS

chore: deploy to AWS #1

Workflow file for this run

name: Deploy Static Site
on:
push:
branches:
- master
- aws-deploy
workflow_dispatch:
permissions:
id-token: write
contents: read
env:
AWS_REGION: ${{ vars.AWS_REGION }}
S3_BUCKET: ${{ vars.S3_BUCKET }}
CLOUDFRONT_DISTRIBUTION_ID: ${{ vars.CLOUDFRONT_DISTRIBUTION_ID }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NUXT_PUBLIC_ASSET_KEY: ${{ secrets.NUXT_PUBLIC_ASSET_KEY }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Generate reports
run: bun run generate-reports
- name: Generate static site
run: bun run generate
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- name: Sync artifacts to S3
run: aws s3 sync .output/public "s3://${S3_BUCKET}" --delete
- name: Invalidate CloudFront
run: aws cloudfront create-invalidation --distribution-id "${CLOUDFRONT_DISTRIBUTION_ID}" --paths "/*"