Skip to content

Commit 2ab7ce6

Browse files
authored
Merge pull request #246 from chaitanya1731/documentation-release
Workflow: Added Github Action to Auto-Generate Documentation
2 parents 51c39e8 + 3502063 commit 2ab7ce6

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/publish.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish Documentation
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build:
12+
permissions:
13+
contents: write # for Git to git push
14+
runs-on: ubuntu-22.04
15+
16+
steps:
17+
- name: Install dependencies
18+
run: |
19+
sudo apt-get update
20+
sudo apt-get install -y python3-venv git
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
ref: main
25+
- name: Set up doc directory
26+
run: |
27+
mkdir $HOME/output
28+
touch $HOME/output/.nojekyll
29+
echo "<meta http-equiv=\"refresh\" content=\"0; URL='development/index.html'\" />" >"$HOME/output/index.html"
30+
- name: Build devel
31+
run: |
32+
export GITHUB_SHA=$(git rev-parse HEAD)
33+
export GITHUB_SHA_REF=$(git rev-parse --abbrev-ref HEAD)
34+
rm -rf _work/venv
35+
make vhtml
36+
mv _build/html $HOME/output/development
37+
- name: Deploy the docs
38+
shell: bash
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
41+
run: |
42+
cd $HOME/output
43+
git init
44+
git config --global user.name "${GITHUB_ACTOR}"
45+
git config --global user.email "${GITHUB_ACTOR}@github.com"
46+
git add .
47+
git commit -m "latest html output"
48+
git push -f https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:gh-pages

0 commit comments

Comments
 (0)