Merge branch 'main' into deploy/production #74
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: Production Build | |
on: | |
push: | |
branches: | |
- deploy/production | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Yarn Install | |
run: | | |
yarn install | |
- name: Use env | |
run: | | |
yarn use:production | |
- name: Move env config | |
run: | | |
rm ./.env.production; | |
mv ./.env ./.env.production; | |
- name: Build | |
run: | | |
yarn build | |
- name: Deploy to S3 | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --acl public-read --delete | |
env: | |
AWS_S3_BUCKET: dag-explorer-production | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: us-west-2 | |
SOURCE_DIR: 'build' | |
- name: Invalidate Cloudfront Distribution | |
uses: chetan/invalidate-cloudfront-action@master | |
env: | |
DISTRIBUTION: E2H01LMIWSMD8J | |
PATHS: '/*' | |
AWS_REGION: us-east-1 | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |