-
-
Notifications
You must be signed in to change notification settings - Fork 56
64 lines (64 loc) · 1.9 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build, Test and Deploy Rules
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@master
- name: Install Dependencies
run: sudo apt-get install -y nodejs jsonlint
- name: Build
run: |
mkdir public
cp CNAME public/CNAME
cp data.min.json public/data.min.json
sha256sum public/data.min.json | awk '{print $1}' > public/rules.min.hash
node build_tools/minifyDataJSON.js "public/data.min.json" "public/data.minify.json"
sha256sum public/data.minify.json | awk '{print $1}' > public/rules.minify.hash
- name: Upload Rules Artifacts
uses: actions/upload-artifact@v2
with:
name: rules-artifact
path: public
test:
name: Test
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Code
uses: actions/checkout@master
- name: Install Dependencies
run: sudo apt-get install -y nodejs jsonlint
- name: Download Rules Artifacts
uses: actions/download-artifact@v2
with:
name: rules-artifact
path: public
- name: Test
run: |
jsonlint-php public/data.min.json
jsonlint-php public/data.minify.json
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout Code
uses: actions/checkout@master
- name: Download Rules Artifacts
uses: actions/download-artifact@v2
with:
name: rules-artifact
path: public
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: gh-pages