This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push to gh-pages | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
push-to-gh-pages: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
path: main | |
- uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Install latest Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
rustflags: '-W warnings' | |
- name: Setup jq | |
uses: dcarbone/[email protected] | |
with: | |
version: '1.6' | |
force: true | |
- name: Check json | |
run: | | |
cd main/nekolib-src | |
sh ls.sh | |
- name: Build documents | |
run: | | |
pwd | |
ls | |
pushd main/nekolib-doc | |
bash crates-ls.sh | |
RUSTDOCFLAGS="--html-in-header=$PWD/katex.html" | |
RUSTDOCFLAGS+=" --html-in-header=$PWD/crates-ls.html" | |
export RUSTDOCFLAGS | |
cargo d | |
popd | |
rm -rf gh-pages/docs | |
mv main/nekolib-doc/target/doc gh-pages/docs | |
- name: Commit changes | |
run: | | |
cd gh-pages | |
git status | |
git add . | |
git config user.name github-actions | |
git config user.email [email protected] | |
git commit -m '[auto-generated]' --allow-empty | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GA_TOKEN }} | |
branch: gh-pages | |
directory: gh-pages |