-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (69 loc) · 2.39 KB
/
docs.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
81
82
83
84
name: Documentation deployment
on: [ push ]
jobs:
check:
name: Check resources
runs-on: ubuntu-latest
steps:
- name: Check jbang-action
uses: jbangdev/[email protected]
with:
trust: https://github.com/nbbrd/jbang-catalog/
script: heylogs@nbbrd
scriptargs: "--version"
deploy:
if: startsWith(github.repository, 'nbbrd/') && ((github.ref == 'refs/heads/develop') || startsWith(github.ref, 'refs/tags/v'))
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
env:
DOC_SLUG: ${{ github.ref_name }}
DOC_URL: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/docs/${{ github.ref_name }}"
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Build pages
run: |
mvn -B -ntp install javadoc:javadoc -DskipTests
touch ./target/site/.nojekyll
- name: Add redirection to Javadoc
run: echo "<html><head><meta http-equiv=\"refresh\" content=\"0; url='apidocs'\"/></head></html>" > ./target/site/index.html
- name: Deploy pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/site
destination_dir: ./docs/${{ env.DOC_SLUG }}
- name: Create summary
run: echo "Documentation available at ${{ env.DOC_URL }}" >> $GITHUB_STEP_SUMMARY
index-dir:
needs: deploy
name: Index GitHub Pages directory
runs-on: ubuntu-latest
steps:
- name: Checkout pages
uses: actions/checkout@v4
with:
ref: 'gh-pages'
- uses: actions/cache@v4
with:
path: /root/.jbang
key: $-jbang-$
restore-keys: |
$-jbang-
- name: Create index.html
uses: jbangdev/[email protected]
with:
trust: https://gist.github.com/charphi/
script: https://gist.github.com/charphi/f44a24eb35dbd61b9f1d7759f0e561bd
scriptargs: -T Documentation docs -o public/index.html -d
env:
JBANG_REPO: /root/.jbang/repository
- name: Deploy index.html
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
destination_dir: ./docs
keep_files: true