From 2498887dfc1909dbcbfbca61f201230adf2fc1f3 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 21 Oct 2019 13:41:06 -0700 Subject: [PATCH] Fix gh-pages deploy. --- .github/workflows/deploy.yml | 18 ++++++++++++------ ci/deploy-gh-pages.sh | 14 -------------- 2 files changed, 12 insertions(+), 20 deletions(-) delete mode 100755 ci/deploy-gh-pages.sh diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4c238338..c93fae75 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,8 +10,6 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@master - name: Install hub @@ -24,16 +22,24 @@ jobs: run: ci/install-rust.sh stable shell: bash - name: Build and deploy artifacts + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ci/make-release.sh ${{ matrix.os }} shell: bash pages: name: GitHub Pages runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@master - name: Install Rust (rustup) run: rustup update stable --no-self-update && rustup default stable - - name: Deploy to GitHub Pages - run: ci/deploy-gh-pages.sh + - name: Build book + run: cargo run -- build book-example + - name: Deploy to GitHub + env: + GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_DEPLOY_KEY }} + 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 diff --git a/ci/deploy-gh-pages.sh b/ci/deploy-gh-pages.sh deleted file mode 100755 index ac591cc7..00000000 --- a/ci/deploy-gh-pages.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/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 config --local user.email "" -git config --local user.name "GitHub Deployer" -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