-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (55 loc) · 1.66 KB
/
pipeline.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
65
66
name: Pipeline
on:
push:
paths:
- 'database/monitors/*.json'
branches:
- master
jobs:
CICD:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Check JSON syntax
uses: limitusus/json-syntax-check@v1
with:
pattern: "\\.json$"
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Check mandatory fields
run: |
python devscript/check_mandatory_fields.py
- name: Build monitors.json file
run: |
export VERSION=$(python devscript/build_monitors_json.py)
echo "::set-env name=VERSION::$VERSION"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
- name: Build MONITORS.md file
run: |
python devscript/build_monitors_md.py
- uses: EndBug/add-and-commit@v7
with:
add: '["database/monitors.json","MONITORS.md"]'
message: 'Update version ${{ env.VERSION }}'
push: true
- name: Publish release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: v${{ env.VERSION }}
prerelease: false
title: v${{ env.VERSION }}
files: |
./database/monitors.json
- name: Build restful api
run: |
python devscript/build_restful_api.py
- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./restful