Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Oct 21, 2019
1 parent 59f98b1 commit 2070cee
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,5 @@ jobs:
- uses: actions/checkout@master
- name: Install Rust (rustup)
run: rustup update stable --no-self-update && rustup default stable
- name: Build gh-pages
run: cargo run -- build book-example
- name: Deploy to GitHub Pages
run: |
touch book-example/book/.nojekyll
curl -LsSf https://raw.githubusercontent.com/rust-lang/simpleinfra/master/setup-deploy-keys/src/deploy.rs | rustc - -o /tmp/deploy
(cd book-example/book && /tmp/deploy)
env:
GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_DEPLOY_KEY }}
run: ci/deploy-gh-pages.sh
12 changes: 12 additions & 0 deletions ci/deploy-gh-pages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Updates gh-pages with latest docs.
set -ex

cargo run -- build book-example
cd book-example/book
touch .nojekyll
git init
git add .
git commit -m "Deploy to gh-pages"
remote="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git push "$remote" HEAD:gh-pages --force
8 changes: 5 additions & 3 deletions ci/make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ then
echo "GITHUB_REF must be set"
exit 1
fi
# Strip mdbook-refs/tags/ from the start of the ref.
TAG=${GITHUB_REF#*/tags/}

host=$(rustc -Vv | grep ^host: | sed -e "s/host: //g")
cargo rustc --bin mdbook --release -- -C lto
cd target/release
case $1 in
ubuntu* | macos*)
asset="mdbook-$GITHUB_REF-$host.tar.gz"
asset="mdbook-$TAG-$host.tar.gz"
tar czf ../../$asset mdbook
;;
windows*)
asset="mdbook-$GITHUB_REF-$host.zip"
asset="mdbook-$TAG-$host.zip"
7z a ../../$asset mdbook.exe
;;
*)
Expand All @@ -29,5 +31,5 @@ if [[ -z "GITHUB_TOKEN" ]]
then
echo "$GITHUB_TOKEN not set, skipping deploy."
else
hub release edit --attach $asset $GITHUB_REF
hub release edit --attach $asset $TAG
fi

0 comments on commit 2070cee

Please sign in to comment.