-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (40 loc) · 1.41 KB
/
build-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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