-
Notifications
You must be signed in to change notification settings - Fork 8
80 lines (74 loc) · 2.24 KB
/
CI.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install linters
run: |
pip install $(grep yamllint requirements.txt)
- name: Lint YAML files
run: yamllint .
- name: Lint Markdown files
uses: DavidAnson/markdownlint-cli2-action@v15
with:
globs: "**/*.md"
build:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup python
uses: actions/[email protected]
with:
python-version: 3.x
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build documentation
run: mkdocs build
deploy:
if: github.event_name == 'push' && contains(fromJson('["refs/heads/master", "refs/heads/main"]'), github.ref)
needs: build
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
docs
- name: Setup python
uses: actions/[email protected]
with:
python-version: 3.x
- name: Install dependencies
run: pip install -r requirements.txt
- name: Deploy to GitHub Pages
run: mkdocs gh-deploy --force
# make_public:
# needs: builds
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
# steps:
# - name: clear CF cache
# run: |
# curl -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \
# -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_CLEAR_CACHE }}" \
# -H "Content-Type:application/json"
# - name: notify discord
# uses: appleboy/discord-action@master
# with:
# webhook_id: ${{ secrets.WEBHOOK_ID }}
# webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
# username: "Selfhosters.net"
# avatar_url: "https://avatars3.githubusercontent.com/u/52747488?s=200"
# message: "New stuff has been added to the wiki"