Skip to content

Workflow file for this run

name: Build & Deploy
permissions:
contents: read
id-token: write
on:
workflow_dispatch:
push:
branches:
- main
- freva/gha
# pull_request:
# branches:
# - main
jobs:
build:
runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Install dependencies
# run: yarn install
#
# - name: Build project
# run: yarn build
#
# - name: Store build artifact
# uses: actions/upload-artifact@v4
# with:
# name: build
# path: dist/
#
# deploy:
# runs-on: ubuntu-latest
#
# needs:
# - build
environment:
name: Production
url: ${{ vars.PUBLIC_URL }}
env:
S3_BUCKET: ${{ vars.S3_BUCKET }}
CF_DISTRIBUTION_ID: ${{ vars.CF_DISTRIBUTION_ID }}
steps:
- name: Debug
run: |
echo '${{ toJSON(vars) }}'
- uses: actions/download-artifact@v4
with:
name: build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: ${{ vars.IAM_ROLE }}
retry-max-attempts: 2
- name: Deploy
run: |
aws s3 sync dist/ "s3://${S3_BUCKET}/frontend/" --exclude "*.map" --no-progress
aws cloudfront create-invalidation --distribution-id "${CF_DISTRIBUTION_ID}" --paths "/*"