42 lines
986 B
YAML
42 lines
986 B
YAML
name: Static Export
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ui/homepage
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'yarn'
|
|
cache-dependency-path: ui/homepage/yarn.lock
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Run export scripts
|
|
run: yarn prebuild
|
|
|
|
- name: Build static bundle
|
|
run: yarn build:static
|
|
|
|
- name: Sync to S3
|
|
run: aws s3 sync ./out s3://$S3_BUCKET --delete
|
|
env:
|
|
S3_BUCKET: ${{ secrets.STATIC_EXPORT_BUCKET }}
|
|
|
|
- name: Invalidate CloudFront cache
|
|
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"
|