-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (73 loc) · 3.12 KB
/
render-wscl.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: Render WSCL
on:
workflow_dispatch:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: install-platform-dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \
curl libzstd1
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# - name: fetch-converter-binary
# run: |
# DOWNLOAD_URL=$(curl -s 'https://api.github.com/repos/scymtym/dpans-conversion/actions/artifacts?per_page=9' \
# | jq '[.artifacts[] | {name : .name, archive_download_url : .archive_download_url}]' \
# | jq -r '.[] | select (.name == "dpans-converter") | .archive_download_url')
# echo "Downloading dpans-converter binary from ${DOWNLOAD_URL}"
# curl --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
# "${DOWNLOAD_URL}" > dpans-converter.zip
# unzip dpans-converter.zip
# chmod +x dpans-converter
- name: fetch-converter-binary
run: |
curl -L https://github.com/scymtym/dpans-conversion/releases/download/test-release/dpans-converter-x86-64-linux \
> dpans-converter
chmod +x dpans-converter
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: render-html
run: |
./dpans-converter "$(pwd)/" "${{ steps.pages.outputs.base_path }}/" --format html \
--issue-annotations true \
--reviewer-annotations true \
--editor-annotations true \
--removable-annotations true \
--with-sidebar true
- name: add-index-html
run: |
echo -e '<html lang="en">\n' > /tmp/output/index.html
echo -e '<head>\n' >> /tmp/output/index.html
echo -e '<meta charset="utf-8">\n' >> /tmp/output/index.html
echo -e '<meta http-equiv="refresh" content="0;url=chap-0.xhtml"/>\n' >> /tmp/output/index.html
echo -e '<link rel="canonical" href="https://s-expressionists.github.io/wscl/chap-0.xhtml"/>\n' >> "${{ steps.pages.outputs.base_path }}/index.html"
echo -e '</head>\n' >> /tmp/output/index.html
echo -e '</html>\n' >> /tmp/output/index.html
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: deploy-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: /tmp/output
destination_dir: ./docs