-
Notifications
You must be signed in to change notification settings - Fork 110
35 lines (30 loc) · 1.1 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Publish
on:
push:
pull_request:
jobs:
publish:
name: GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get mdBook
run: |
export MDBOOK_VERSION="v0.4.5"
export MDBOOK_TARBALL="mdbook-${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
export MDBOOK_URL="https://github.com/rust-lang/mdBook/releases/download/${MDBOOK_VERSION}/${MDBOOK_TARBALL}"
curl -Lf "${MDBOOK_URL}" | tar -xz
- name: Build
run: ./mdbook build
- name: Push to gh-pages
if: ${{github.ref == 'refs/heads/master'}}
working-directory: book
run: |
REV=$(git rev-parse --short HEAD)
git init
git remote add upstream https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/rust-lang/api-guidelines
git config user.name "Rust API Guidelines"
git config user.email "[email protected]"
git add -A .
git commit -qm "API Guidelines @ ${{github.repository}}@${REV}"
git push -q upstream HEAD:refs/heads/gh-pages --force