-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (38 loc) · 849 Bytes
/
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
on:
push:
branches:
- main
tags:
- '!*'
pull_request:
branches:
- main
name: main
jobs:
update_github_pages:
name: Update github pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run lint
run: |
set -e
npm ci
npm run lint
- name: Run build
run: npm run build
- name: Publish ghpages branch
if: github.ref == 'refs/heads/main'
run: |
set -e
mv dist ..
git checkout --orphan ghpages
git reset --hard
rm -Rf node_modules
cp -R ../dist/* .
git add .
git status
git config --global user.name 'Dirk Lemstra'
git config --global user.email '[email protected]'
git commit -m "Updated GitHub pages"
git push --force origin ghpages