Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Staging deploy - AWS #2917

Staging deploy - AWS

Staging deploy - AWS #2917

Workflow file for this run

name: Staging deploy - AWS
on:
schedule:
# run around 9:00am on Mondays, 3:55 on Wednesdays, 7:55 Thurs
- cron: '0 17 * * Mon'
- cron: '55 23 * * Wed'
- cron: '55 15 * * Thu'
push:
branches:
- staging
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to call this workflow from another workflow -- see equity_deploy_staging.yml
workflow_call:
jobs:
build_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: staging
submodules: true
- uses: n1hility/cancel-previous-runs@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
workflow: staging_aws.yml
- name: Build 11ty
run: |
npm install
npm run build:staging
# Push built site files to S3 production bucket
- 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
# Push built site files to S3 production bucket
- name: Deploy to S3
run: aws s3 sync --follow-symlinks --delete ./docs s3://staging.covid19.ca.gov
#
# Invalidate Cloudfront production distribution (everything under data)
- name: invalidate Cloudfront
run: AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id E17SNE7QRMFCI3 --paths "/*"