This repository has been archived by the owner on May 28, 2024. It is now read-only.
SVG pregeneration #1041
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: SVG pregeneration | |
on: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '15,20,25,45,55 17 * * 5' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: szenius/[email protected] | |
with: | |
timezoneLinux: "America/Los_Angeles" | |
- uses: actions/checkout@v2 | |
- run: | | |
git pull | |
npm install | |
npm run svgPregen | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add img/generated/sparklines/* | |
git commit -m "generated sparkline charts" | |
git push origin main | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
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 --acl public-read --follow-symlinks --delete ./img/generated s3://files.covid19.ca.gov/img/generated | |
- name: invalidate Cloudfront | |
run: aws cloudfront create-invalidation --distribution-id E21D0URMALUUJ4 --paths "/img/generated*" | |
# # | |
# # Sync SVGs to S3 (files.covid19.ca.gov bucket) | |
# - name: Deploy to S3 (files) (img) | |
# uses: jakejarvis/[email protected] | |
# with: | |
# args: --acl public-read --follow-symlinks --delete | |
# env: | |
# AWS_S3_BUCKET: 'files.covid19.ca.gov' | |
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# AWS_REGION: 'us-west-1' | |
# SOURCE_DIR: ./img/generated | |
# DEST_DIR: img/generated | |
# # | |
# # Invalid Cloudfront production dist for files.covid19.ca.gov (awaiting cert) | |
# - name: invalidate | |
# uses: chetan/[email protected] | |
# env: | |
# DISTRIBUTION: 'E21D0URMALUUJ4' | |
# PATHS: '/img/generated /img/generated/*' | |
# AWS_REGION: 'us-west-1' | |
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |