-
-
Notifications
You must be signed in to change notification settings - Fork 35
78 lines (73 loc) · 2.18 KB
/
document.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
name: document
on:
push:
branches:
- main
- dev
jobs:
asciidoc:
runs-on: ubuntu-latest
container:
image: asciidoctor/docker-asciidoctor
steps:
- uses: actions/checkout@v4
- name: build html for DEV
if: github.ref == 'refs/heads/dev'
run: asciidoctor -o target/html/index.html doc/pages/index.adoc -a 'help_html=https://vim-iced-nightly.netlify.com/vim-iced.html'
- name: build html for PROD
if: github.ref == 'refs/heads/main'
run: asciidoctor -o target/html/index.html doc/pages/index.adoc
- uses: actions/upload-artifact@master
with:
name: asciidoc_index.html
path: target/html/index.html
help:
needs: asciidoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: build help html
run: bash scripts/html.sh
- uses: actions/download-artifact@master
with:
name: asciidoc_index.html
path: tmp/html
- name: copy index.html
run: cp -pf tmp/html/index.html target/html/index.html
- name: copy assets
run: cp -pr doc/pages/assets target/html/assets
- uses: actions/upload-artifact@master
with:
name: document
path: target/html
nightly-deploy:
if: github.ref == 'refs/heads/dev'
needs: [asciidoc, help]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@master
with:
name: document
path: document
- uses: netlify/actions/cli@master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_PERSONAL_ACCESS_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
args: deploy --dir=document --prod
deploy:
if: github.ref == 'refs/heads/main'
needs: [asciidoc, help]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@master
with:
name: document
path: document
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./document