This repository has been archived by the owner on May 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (57 loc) · 2.29 KB
/
svg-pregen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: SVG pregeneration
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '15,20,25,45,55 16 * * 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 }}