Merge pull request #325 from sebastienrousseau/dependabot/cargo/serde… #452
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: 🧪 Document | |
on: | |
push: | |
branches: | |
- main | |
- feat/ssg | |
pull_request: | |
branches: | |
- feat/ssg | |
release: | |
types: [created] | |
jobs: | |
all: | |
name: Document | |
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: hecrj/[email protected] | |
with: | |
rust-version: nightly | |
- uses: actions/[email protected] | |
- name: Update libssl | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libssl1.1 | |
- name: Generate documentation for all features and publish it | |
run: | | |
RUSTDOCFLAGS="--cfg docsrs" \ | |
cargo doc --no-deps --all-features --workspace | |
# Write index.html with redirect | |
echo '<html><head><meta http-equiv="refresh" content="0; url=/ssg/"></head><body></body></html>' > ./target/doc/index.html | |
- name: Deploy | |
uses: actions/[email protected] | |
with: | |
name: documentation | |
path: target/doc | |
if-no-files-found: error | |
retention-days: 1 | |
- name: Write CNAME file | |
run: echo 'doc.shokunin.one' > ./target/doc/CNAME | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./target/doc | |
publish_branch: gh-pages | |
cname: true | |
commit_message: Deploy documentation at ${{ github.sha }} | |
user_name: github-actions | |
user_email: [email protected] |