Skip to content

Build and deploy

Build and deploy #46

Workflow file for this run

---
name: Build and deploy
on:
workflow_dispatch:
env:
AWS_REGION: us-west-1
AWS_ROLE: GitHubS3Sync
AWS_S3_BUCKET: generators.finn.fun
AWS_SESSION_NAME: DeployConfigurableGenerators
jobs:
deploy-to-s3:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm ci
- run: npm run build
- uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE }}
role-session-name: ${{ env.AWS_SESSION_NAME }}
- run: aws s3 sync build "s3://${AWS_S3_BUCKET}" && aws cloudfront create-invalidation --distribution-id 'ED227UN54U5OB' --paths '/*'