-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: gh-pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "doc-debug" | ||
- "rkuris/doc-it-hurts-when-i-do-this" | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- uses: arduino/setup-protoc@v2 | ||
# caution: this is the same restore as in ci.yaml | ||
- name: Restore Cargo Cache | ||
id: cargo-cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
# We can do this now because we use specific verison and update with Dependabot | ||
# but if we make the deps any less specifc, we'll have to fix | ||
key: ${{ runner.os }}-deps-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/*.rs') }} | ||
# start from the previous set of cached dependencies | ||
restore-keys: | | ||
${{ runner.os }}-deps-${{ hashFiles('**/Cargo.toml') }}- | ||
${{ runner.os }}-deps- | ||
- name: Build | ||
run: cargo doc --no-deps | ||
- name: Set up _site redirect to firewood | ||
run: | | ||
rm -fr _site | ||
mkdir _site | ||
echo "<meta http-equiv=\"refresh\" content=\"0; url=firewood\">" > _site/index.html | ||
- name: Copy doc files to _site | ||
run: | | ||
cp -rv target/doc/* ./_site | ||
cp -rv docs/assets ./_site | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: pages | ||
path: _site | ||
if-no-files-found: error | ||
deploy: | ||
needs: build | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download pages artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: pages | ||
path: . | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: . | ||
- name: Deploy to GitHub pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |