This repository has been archived by the owner on May 28, 2024. It is now read-only.
removed equity translated posts #14244
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: Eleventy Build Master | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: n1hility/cancel-previous-runs@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build 11ty | |
run: | | |
npm install | |
npm run build | |
- name: Save Commit Context | |
uses: finnp/create-file-action@master | |
env: | |
FILE_NAME: "./docs/commit-info.json" | |
FILE_DATA: ${{ toJson(github.event.commits) }} | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
- name: npm test | |
run: | | |
npm run test:setup | |
npm test | |
env: | |
CI: true | |
# Deploy to this branch that Azure workflow watches for changes and deploys to Azure production | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
publish_dir: ./docs | |
publish_branch: deploy_production | |
commit_message: ${{ github.event.head_commit.message }} | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
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 ./docs s3://covid19.ca.gov | |
- name: Reset cache-control on static fonts | |
run: aws s3 sync --cache-control max-age=15552000 ./docs/fonts s3://covid19.ca.gov/fonts | |
# the original version of this was writing to the fonts directory (invalid) | |
# i suspect this is not actually needed | |
- name: Reset cache-control on static img | |
run: aws s3 sync --cache-control max-age=15552000 ./docs/img s3://covid19.ca.gov/img | |
# Create all the redirects on S3, only do this on production we don't want this set of redirects in all environments | |
- name: Deploy redirects | |
run: | | |
AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} npm run deploy:redirects | |
- name: invalidate Cloudfront | |
run: AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id EUZDM53N8V5KD --paths "/*" | |