Pack layout (#30) #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: Build and Deploy | |
# Runs build and deploy whenever main is merged to or pushed to. | |
# (...please don't push directly to main) | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node/NPM | |
uses: actions/setup-node@v3 | |
with: | |
# Just picked what we've been using in local dev work | |
node-version: 18 | |
- name: Install node modules | |
# `npm ci` tells npm to install matching against package-lock file | |
run: npm ci | |
- name: Setting up Vite env vars | |
env: | |
GALAGO_VITE_ENV_VARS: ${{ secrets.GALAGO_VITE_ENV_VARS }} | |
run: | | |
echo Setting up Vite env vars file | |
echo "$GALAGO_VITE_ENV_VARS" > .env | |
- name: Build app | |
# Saw issues with build running out of memory in GitHub Actions | |
# Resolve per https://github.com/actions/runner-images/issues/70 | |
env: | |
NODE_OPTIONS: "--max-old-space-size=4096" | |
# As configured in Aug 2022, `vite build` outputs to `dist` folder. | |
run: npm run build | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: dist # see above, default output folder for `vite build` | |
# By default, deploys branch to `gh-pages`, but let's be explicit | |
branch: gh-pages |