forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.4 KB
/
publish-ghpages.yaml
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
name: publish-ghpages
on:
workflow_dispatch:
push:
branches:
- '*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
# Do NOT checkout this. It is a kernel tree and takes a long time, and it's not necessary.
- name: Grab README.md
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
curl -s https://raw.githubusercontent.com/${{ github.repository }}/${BRANCH_NAME}/README.md > README.md
ls -la README.md
# install grip via pip, https://github.com/joeyespo/grip; rpardini's fork https://github.com/rpardini/grip
- name: Install grip
run: |
pip3 install https://github.com/rpardini/grip/archive/refs/heads/master.tar.gz
- name: Run grip to gen ${{ github.head_ref || github.ref_name }}
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
mkdir -p public
grip README.md --context=${{ github.repository }} --title="${BRANCH_NAME}" --wide --user-content --export "public/${BRANCH_NAME}.html" || true
ls -la public/
- name: Deploy to GitHub Pages (gh-pages branch)
if: success()
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: public
keep_history: true
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}