Merge pull request #987 from cagov/release/1.0.12-butte #379
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 design system site | |
# site: designsystems.webstandards.ca.gov | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: n1hility/cancel-previous-runs@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@master | |
- name: Use Node.js 21 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 21 | |
- name: Build Site | |
run: | | |
npm install | |
npm run site:build | |
- name: Write robots.txt | |
run: | | |
echo 'User-agent: *' > _site/robots.txt | |
echo 'Allow: /' >> _site/robots.txt | |
echo 'Sitemap: https://designsystem.webstandards.ca.gov/sitemap.xml' >> docs/robots.txt | |
# Push built site files to S3 production bucket | |
- name: Deploy to S3 | |
uses: jakejarvis/[email protected] | |
with: | |
args: --follow-symlinks --delete | |
env: | |
AWS_S3_BUCKET: 'designsystem.webstandards.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' # optional: defaults to us-east-1 | |
SOURCE_DIR: ./_site # only move built directory | |
# Invalidate Cloudfront production distribution | |
- name: invalidate | |
uses: chetan/[email protected] | |
env: | |
DISTRIBUTION: 'E1GP67RJOCAKQE' | |
PATHS: '/*' | |
AWS_REGION: 'us-west-1' | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |