Merge pull request #151 from brown-ccv/test-subroutes #72
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: prod-deploy | |
on: | |
push: | |
branches: | |
- main | |
repository_dispatch: | |
types: | |
- prod-deploy | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: npm ci | |
- name: Init submodule | |
run: | | |
git submodule set-branch -b main content | |
git submodule update --remote | |
- name: Build | |
# Make sure content is tracking main and up-to date, then builds and deploys | |
run: | | |
export NODE_OPTIONS="--max_old_space_size=4096" | |
npm run generate | |
npm run build | |
npm run predeploy | |
- name: Deploy to Firebase | |
run: npm run prod-deploy | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |
- name: Remove content folder (extra git module instance confuses gh) | |
run: rm -rf functions/content |