-
-
Notifications
You must be signed in to change notification settings - Fork 4
81 lines (67 loc) · 2.03 KB
/
gh-pages.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
name: Github Pages
on:
push:
branches:
- main
tags:
- '*'
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: 'latest'
- run: mdbook build book
- name: Set output directory
run: |
OUTDIR=$(basename ${{ github.ref }})
echo "OUTDIR=$OUTDIR" >> $GITHUB_ENV
- name: Deploy stable
uses: peaceiris/actions-gh-pages@v4
if: startswith(github.ref, 'refs/tags/')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/book
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/book
destination_dir: ./${{ env.OUTDIR }}
generate-con:
name: Generate CONTRIBUTORS.svg
runs-on: ubuntu-latest
permissions:
contents: write
needs: deploy
if: always()
steps:
- uses: actions/checkout@v4
- name: Pull gh-pages
run: |
git config --global user.name 'Adam Perkowski'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/adamperkowski/highlightos
git checkout --orphan gh-pages
git rm -rf .
git pull origin gh-pages
git checkout gh-pages
- name: Generate Contributors Images
uses: jaywcjlove/github-action-contributors@main
with:
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
output: CONTRIBUTORS.svg
avatarSize: 42
- name: Push the svg
run: |
git add CONTRIBUTORS.svg || true
git commit -am "update `CONTRIBUTORS.svg`" || true
git push --set-upstream origin gh-pages || true