Skip to content

Commit 03318e6

Browse files
committed
restore gh-pages use for docs
1 parent 2fa5b5a commit 03318e6

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/gh-pages.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
6+
name: Publish Docs
7+
jobs:
8+
publish_docs:
9+
if: github.repository == 'KWARC/rust-libxml'
10+
name: Publish Docs
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: install dependencies
14+
uses: ryankurte/[email protected]
15+
with:
16+
packages: "libxml2-dev"
17+
- name: Set up LIBXML2 env var if compiling with the default bindings
18+
run: echo "LIBXML2=$(pkg-config libxml-2.0 --variable=libdir)/libxml2.so" >> "$GITHUB_ENV"
19+
- uses: actions-rs/toolchain@v1
20+
with:
21+
profile: minimal
22+
toolchain: stable
23+
override: true
24+
- name: Checkout sources
25+
uses: actions/checkout@v4
26+
- name: Build Documentation
27+
uses: actions-rs/cargo@v1
28+
with:
29+
command: doc
30+
args: --all --no-deps
31+
32+
- name: Deploy Documentation
33+
env:
34+
PUBLISH_BRANCH: gh-pages
35+
PUBLISH_DIR: ./target/doc
36+
run: |
37+
git config user.name "${GITHUB_ACTOR}"
38+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
39+
git fetch origin ${PUBLISH_BRANCH}
40+
git checkout ${PUBLISH_BRANCH}
41+
find "${GITHUB_WORKSPACE}/${PUBLISH_DIR}" -maxdepth 1 | tail -n +2 | xargs -I % cp -rf % "."
42+
git add --all
43+
git commit --allow-empty -m "Automated deployment: $(date -u) ${GITHUB_SHA}"
44+
git push origin ${PUBLISH_BRANCH}

0 commit comments

Comments
 (0)