Deploy #3195
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 | |
on: | |
push: | |
branches: | |
- development | |
- main | |
schedule: | |
- cron: "6 1 * * *" # Run once daily | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: us-east-2 | |
AIRTABLE_BASE: ${{ secrets.AIRTABLE_BASE }} | |
AIRTABLE_KEY: ${{ secrets.AIRTABLE_KEY }} | |
AIRTABLE_TABLE: ${{ secrets.AIRTABLE_TABLE }} | |
AIRTABLE_VIEW: ${{ secrets.AIRTABLE_VIEW }} | |
REPORT_ERROR_PATH: ${{ secrets.REPORT_ERROR_PATH }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: 3.7 | |
- name: Install AWS CLI | |
run: | | |
python -m pip install --upgrade pip | |
pip install awscli | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: "11.x" | |
- name: Cache JS dependencies | |
uses: actions/cache@v1 | |
with: | |
path: node_modules | |
key: npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
npm- | |
- run: make install | |
- name: "Staging: Build and deploy" | |
if: github.ref == 'refs/heads/development' | |
env: | |
SITE_URL: https://covid-staging.citybureau.org | |
S3_BUCKET: city-bureau-covid-staging | |
CLOUDFRONT_ID: ${{ secrets.CLOUDFRONT_ID_STAGE }} | |
run: | | |
make build | |
make deploy | |
- name: "Production: Build and deploy" | |
if: github.ref == 'refs/heads/main' | |
env: | |
S3_BUCKET: city-bureau-covid-prod | |
CLOUDFRONT_ID: ${{ secrets.CLOUDFRONT_ID_PROD }} | |
run: | | |
make build | |
make deploy |