Merge pull request rust-lang/std-dev-guide#63 from saethlin/unsafe-pr… #39
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: github pages | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Read .env | |
id: mdbook-version | |
run: | | |
. ./.env | |
echo "MDBOOK_VERSION=${MDBOOK_VERSION}" >> $GITHUB_OUTPUT | |
echo "MDBOOK_LINKCHECK_VERSION=${MDBOOK_LINKCHECK_VERSION}" >> $GITHUB_OUTPUT | |
echo "MDBOOK_TOC_VERSION=${MDBOOK_TOC_VERSION}" >> $GITHUB_OUTPUT | |
- name: Cache binaries | |
id: mdbook-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin | |
key: ${{ runner.os }}-${{ steps.mdbook-version.outputs.MDBOOK_VERSION }}--${{ steps.mdbook-version.outputs.MDBOOK_LINKCHECK_VERSION }}--${{ steps.mdbook-version.outputs.MDBOOK_TOC_VERSION }} | |
- name: Install latest stable Rust toolchain | |
if: steps.mdbook-cache.outputs.cache-hit != 'true' | |
run: | | |
rustup update stable | |
rustup override set stable | |
- name: Install Dependencies | |
if: steps.mdbook-cache.outputs.cache-hit != 'true' | |
run: | | |
cargo install mdbook --version ${{ steps.mdbook-version.outputs.MDBOOK_VERSION }} | |
cargo install mdbook-linkcheck --version ${{ steps.mdbook-version.outputs.MDBOOK_LINKCHECK_VERSION }} | |
cargo install mdbook-toc --version ${{ steps.mdbook-version.outputs.MDBOOK_TOC_VERSION }} | |
- name: Build book | |
run: | | |
. ./.env | |
mdbook build | |
cp CNAME $GIT_DEPLOY_DIR | |
- name: Deploy to gh-pages | |
run: | | |
git config --global user.email "Runner@GH Actions Deployment" | |
git config --global user.name "GH Actions Runner" | |
chmod u+x ci/ghpages-deploy.sh | |
./ci/ghpages-deploy.sh |