-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 1.73 KB
/
githubActions.yml
File metadata and controls
71 lines (59 loc) · 1.73 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Pull form submissions
permissions:
contents: write
on:
workflow_dispatch:
push:
branches: ["main"]
jobs:
build:
environment: github-pages
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: "NMSUD/Form"
path: nmsud-form
ref: main
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: nmsud-form/package-lock.json
- name: Setup Secrets
env:
XATA_API_KEY: ${{ secrets.XATA_API_KEY }}
XATA_DB_URL: ${{ secrets.XATA_DB_URL }}
XATA_FALLBACK_BRANCH: ${{ secrets.XATA_FALLBACK_BRANCH }}
NMSUD_IMG_BASE_URL: ${{ secrets.NMSUD_IMG_BASE_URL }}
run: |
cd nmsud-form
touch .env
echo XATA_API_KEY="$XATA_API_KEY" >> .env
echo XATA_DB_URL="$XATA_DB_URL" >> .env
echo XATA_FALLBACK_BRANCH="$XATA_FALLBACK_BRANCH" >> .env
echo NMSUD_IMG_BASE_URL="$NMSUD_IMG_BASE_URL" >> .env
- name: Pull data from Form Submissions
run: |
cd nmsud-form
npm ci
npm run data:downloader
cp -r data ../data
- name: Build Index.html
run: |
echo "" > .gitignore
npm run build
- name: Add .nojekyll
run: |
cd data
touch .nojekyll
- uses: JamesIves/github-pages-deploy-action@v4
name: Deploy to GitHub Pages
if: github.event_name != 'pull_request'
with:
folder: data