This repository has been archived by the owner on Jul 9, 2024. It is now read-only.
Feat; add spinner component (#146) #231
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build storybook and deploy to S3/CloudFront | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
webapp: | |
name: Deploy storybook | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set env outputs on branch | |
id: env | |
run: | | |
BUCKET="govconnex-ui-storybook-deploy" | |
BUCKET_REGION="ap-southeast-2" | |
DIST_ID="E3VRYJS0VLBOLI" | |
echo "::set-output name=bucket::$BUCKET" | |
echo "::set-output name=bucket_region::$BUCKET_REGION" | |
echo "::set-output name=dist_id::$DIST_ID" | |
- uses: c-hive/gha-yarn-cache@v2 | |
- name: Install packages | |
run: | | |
echo "//npm.fontawesome.com/:_authToken=${{ secrets.FONTAWESOME_NPM_TOKEN }}" >> .npmrc | |
yarn install | |
- name: Run tests | |
run: yarn test | |
- name: Build Storybook | |
run: yarn build | |
- name: Upload to S3 | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --follow-symlinks --delete | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_S3_BUCKET: ${{ steps.env.outputs.bucket }} | |
AWS_REGION: ${{ steps.env.outputs.bucket_region }} | |
SOURCE_DIR: 'storybook-static' | |
- name: Invalidate CloudFront cache | |
uses: chetan/invalidate-cloudfront-action@master | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
DISTRIBUTION: ${{ steps.env.outputs.dist_id }} | |
PATHS: '/*' | |
AWS_REGION: ${{ steps.env.outputs.bucket_region }} |