ci: move to Nix #3910
Workflow file for this run
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: Publish Nightly Docs | |
on: [push, pull_request] | |
jobs: | |
build_docs: | |
name: Build docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@v5 | |
# Cache Nix artifacts | |
- uses: DeterminateSystems/magic-nix-cache-action@v2 | |
- name: Build docs | |
run: nix develop -L .#docsNightly --command bash -c "cargo doc --no-deps" | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: built-docs | |
path: ./target/doc/* | |
publish_docs: | |
name: 'Publish docs' | |
if: github.ref == 'refs/heads/master' | |
needs: [build_docs] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout `bitcoindevkit.org` | |
uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.DOCS_PUSH_SSH_KEY }} | |
repository: bitcoindevkit/bitcoindevkit.org | |
ref: master | |
- name: Create directories | |
run: mkdir -p ./docs/.vuepress/public/docs-rs/bdk/nightly | |
- name: Remove old latest | |
run: rm -rf ./docs/.vuepress/public/docs-rs/bdk/nightly/latest | |
- name: Download built docs | |
uses: actions/download-artifact@v3 | |
with: | |
name: built-docs | |
path: ./docs/.vuepress/public/docs-rs/bdk/nightly/latest | |
- name: Configure git | |
run: git config user.email "[email protected]" && git config user.name "github-actions" | |
- name: Commit | |
continue-on-error: true # If there's nothing to commit this step fails, but it's fine | |
run: git add ./docs/.vuepress/public/docs-rs && git commit -m "Publish autogenerated nightly docs" | |
- name: Push | |
run: git push origin master |