spin-update #1231
This file contains hidden or 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: Spin docs | |
on: | |
repository_dispatch: | |
types: | |
- spin-update | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: 'Spin branch or tag' | |
required: true | |
default: 'main' | |
jobs: | |
publish-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dispatch variables | |
env: | |
repository_dispatch_ref: ${{ github.event.client_payload.ref }} | |
workflow_dispatch_ref: ${{ inputs.ref }} | |
run: 'echo spin_ref=${repository_dispatch_ref:-$workflow_dispatch_ref} >> $GITHUB_ENV' | |
- uses: actions/checkout@v3 | |
with: | |
repository: "spinframework/spin" | |
ref: ${{ env.spin_ref }} | |
path: spin | |
# Use nightly to enable unstable (-Z) options | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
target: wasm32-wasip1 | |
default: true | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: spin | |
- name: 'Build docs' | |
working-directory: spin | |
env: | |
RUSTDOCFLAGS: '-Zunstable-options --enable-index-page' | |
run: 'cargo doc -Zrustdoc-map --no-deps --all --exclude spin-cli --exclude conformance --exclude "*test*"' | |
- uses: actions/checkout@v3 | |
with: | |
path: rust-docs | |
- name: 'Push docs' | |
working-directory: rust-docs | |
env: | |
OUT: 'docs/spin/${{ env.spin_ref }}' | |
run: | | |
rm -rf $OUT | |
mkdir -p docs/spin | |
mv -T ../spin/target/doc $OUT | |
git add $OUT | |
git config user.name spinframeworkbot | |
git config user.email [email protected] | |
git commit -m "Update $OUT" | |
git push |