-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (45 loc) · 1.19 KB
/
ci.yml
File metadata and controls
48 lines (45 loc) · 1.19 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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm install jshint uglify-js copyfiles mkdirp
- run: npm run lint
- run: npm run deploy
- uses: actions/upload-artifact@v2
with:
name: build
path: build
pages:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout gh-pages
uses: actions/checkout@v2
with:
ref: gh-pages
path: gh-pages
- name: Download build
uses: actions/download-artifact@v2
with:
name: build
path: build
- name: Publish to github pages
run: |
cd gh-pages
rm -rf * .github
mv ../build/* .
touch .nojekyll # https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/
git config user.name gh-actions
git config user.email gh-actions@github.com
git add .
git commit --reset-author --amend -m "Autodeploy"
git push --force origin gh-pages