Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on:
push:
branches: [main]

env:
rust_version: 1.51.0

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: Generate docs
run: cargo +nightly doc --target-dir ../docs-new --no-deps
env:
RUSTDOCFLAGS: "--enable-index-page -Zunstable-options"
working-directory: sdk
- name: Push the docs
run: |
ls
git checkout -B gh-pages
ls
rm -rf docs
mv docs-new/doc docs
git config --local user.email "docs-action@github.com"
git config --local user.name "GitHub Action (docs)"
git add docs
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question/concern

is this secret going to show up in the logs? If so you might consider using a credential helper or a simple shell script via GIT_ASKPASS

git commit -m 'Add docs'
git push -f origin gh-pages