-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (38 loc) · 1.23 KB
/
main.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
43
44
45
46
47
name: build and test
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
- run: npm install
- name: validate registries
run: npm run validate
- name: verify that the registries are canonicalized
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
run: |
npm run canonicalize
git add src/main/data
git diff-index --quiet HEAD src/main/data
- name: commit canonicalized registries
if: github.ref != 'refs/heads/main' && github.event_name != 'pull_request'
run: |
npm run canonicalize
git add src/main/data
git config --global user.name 'Steve LLamb'
git config --global user.email '[email protected]'
git diff-index --quiet HEAD src/main/data || git commit -m "Registries have been canonicalized"
git push
- run: npm run build
env:
GH_PAGES_BUILD: true
- uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build