From 4aac833073452d47f8e7086af172013a50e1c20d Mon Sep 17 00:00:00 2001 From: Alekos Filini Date: Thu, 3 Dec 2020 15:00:04 +0100 Subject: [PATCH] [ci] Build and publish nightly docs --- .github/workflows/nightly_docs.yml | 63 ++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/nightly_docs.yml diff --git a/.github/workflows/nightly_docs.yml b/.github/workflows/nightly_docs.yml new file mode 100644 index 00000000..d3ad4ab2 --- /dev/null +++ b/.github/workflows/nightly_docs.yml @@ -0,0 +1,63 @@ +name: Publish Nightly Docs + +on: + push: + branches: + - master + +jobs: + build_docs: + name: Build docs + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Setup cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: nightly-docs-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} + - name: Install nightly toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - name: Build docs + uses: actions-rs/cargo@v1 + with: + command: rustdoc + args: --verbose --features=compiler,electrum,esplora,compact_filters,key-value-db,all-keys -- --cfg docsrs + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: built-docs + path: ./target/doc/* + + publish_docs: + name: 'Publish docs' + needs: [build_docs] + runs-on: ubuntu-latest + steps: + - name: Checkout `bitcoindevkit.org` + uses: actions/checkout@v2 + with: + ssh-key: ${{ secrets.DOCS_PUSH_SSH_KEY }} + repository: bitcoindevkit/bitcoindevkit.org + ref: master + - name: Create directories + run: mkdir -p ./static/docs-rs/bdk/nightly + - name: Remove old latest + run: rm -rf ./static/docs-rs/bdk/nightly/latest + - name: Download built docs + uses: actions/download-artifact@v1 + with: + name: built-docs + path: ./static/docs-rs/bdk/nightly/latest + - name: Configure git + run: git config user.email "github-actions@github.com" && git config user.name "github-actions" + - name: Commit and push + run: git add ./static && git commit -m "Publish autogenerated nightly docs" && git push origin master