Added S3 sync. #3
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: Deploy PROD innovation-hub.ca.gov | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: n1hility/cancel-previous-runs@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/[email protected] | |
- name: Use Node.js 16.13.1 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.13.1 | |
- name: Build 11ty | |
run: | | |
mkdir _site | |
mkdir _site_dist | |
npm install --legacy-peer-deps | |
npm run build | |
# Push built site files to S3 production bucket | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-west-1 | |
- name: Deploy to S3 | |
run: aws s3 sync --follow-symlinks --delete ./_site s3://innovation-hub.ca.gov | |
# - name: invalidate Cloudfront | |
# run: AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id EUZDM53N8V5KD --paths "/*" |