Skip to content

Build and Deploy

Build and Deploy #1472

Workflow file for this run

# Adapted from:
# https://github.com/marketplace/actions/deploy-to-github-pages#getting-started-airplane
name: Build and Deploy
on:
push:
branches: [ main ]
schedule:
# Use https://crontab.guru/ to figure out what this means.
#
# * is a special character in YAML so you have to quote this string
- cron: '0 4 * * *'
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/[email protected] # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- name: Set Timezone 🕑
uses: zcong1993/setup-timezone@master # Adapted from: https://github.com/marketplace/actions/setup-timezone
with:
timezone: America/New_York
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
env:
NYCDB_URL: ${{ secrets.NYCDB_URL }}
REACT_APP_PASSWORD: ${{ secrets.REACT_APP_PASSWORD }}
VITE_BASE_URL: rtc-eviction-viz
run: |
npm install
npm run build-data
npm run build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: dist # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch