Skip to content

Commit 6fbf640

Browse files
authored
Merge pull request #225 from rust-lang/publish
Switch gh-pages publish to GitHub Actions
2 parents 524e561 + f55e290 commit 6fbf640

File tree

3 files changed

+40
-36
lines changed

3 files changed

+40
-36
lines changed

.github/workflows/deploy.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
publish:
9+
name: GitHub Pages
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Get mdBook
15+
run: |
16+
export MDBOOK_VERSION="v0.4.2"
17+
export MDBOOK_TARBALL="mdbook-${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
18+
export MDBOOK_URL="https://github.com/rust-lang/mdBook/releases/download/${MDBOOK_VERSION}/${MDBOOK_TARBALL}"
19+
curl -Lf "${MDBOOK_URL}" | tar -xz
20+
21+
- name: Build
22+
run: ./mdbook build
23+
24+
- name: Push to gh-pages
25+
if: ${{github.ref == 'master'}}
26+
working-directory: book
27+
run: |
28+
REV=$(git rev-parse --short HEAD)
29+
git init
30+
git remote add upstream https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/rust-lang/api-guidelines
31+
git config user.name "Rust API Guidelines"
32+
git config user.email "[email protected]"
33+
git add -A .
34+
git commit -qm "API Guidelines @ ${{github.repository}}@${REV}"
35+
eval `ssh-agent`
36+
ssh-add - <<< "$deploy_key"
37+
git push -q upstream HEAD:refs/heads/gh-pages-test --force

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
book
1+
/book
2+
/mdbook
3+
/mdbook-*.tar.gz

.travis.yml

-35
This file was deleted.

0 commit comments

Comments
 (0)