Skip to content

deploy docs

deploy docs #104

Workflow file for this run

name: deploy docs
on:
workflow_run:
workflows:
- tests
types:
- completed
branches:
- wiwi
jobs:
docs:
name: run
runs-on: ubuntu-24.04
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: setup rust
run: rustc --version
- name: install fish shell (lazy)
run: |
sudo add-apt-repository -yn ppa:fish-shell/release-3
sudo apt-get update
sudo apt-get install fish
- name: generate docs
shell: fish {0}
run: |
set -gx RUSTDOCFLAGS "--cfg docsrs --cfg kiwingay -Z unstable-options --enable-index-page --theme "(pwd)"/.cargo/rustdoc-custom-theme/meadow.css"
set -gx KIWINGAY_DEPLOY_COMMIT_SHORT (string sub --length 8 $KIWINGAY_DEPLOY_COMMIT)
cargo doc --verbose --no-deps --features all-unstable,all-addons --lib -p wiwi -p wiwiwiwiwi
env:
KIWINGAY_DEPLOY_COMMIT: ${{ github.sha }}
- name: checkout gh-pages branch
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: gh-pages
ref: gh-pages
- name: deploy docs
shell: fish {0}
run: |
rm -rf gh-pages/*
mv gh-pages/.git gh-pages/git
rm -rf gh-pages/.*
mv gh-pages/git gh-pages/.git
cp -R target/doc/* gh-pages
cp -R target/doc/.* gh-pages
cp .gitignore gh-pages/.gitignore
touch gh-pages/.nojekyll
echo wiwi.kiwin.gay > gh-pages/CNAME
set COMMIT_MESSAGE "(automated) deploy from commit "(git rev-parse HEAD)
cd gh-pages
git config --global user.name "smol"
git config --global user.email "[email protected]"
echo https://meadowsys:${{ secrets.GHPAT }}@github.com > .git/credentials
git config --global credential.helper "store --file=.git/credentials"
git config --unset-all http.https://github.com/.extraheader # https://stackoverflow.com/a/69979203
git add -A
git commit -m "$COMMIT_MESSAGE" --allow-empty
git push