diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f043c5242ce..823551c46ae 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,7 +1,8 @@ name: Rust on: - push: + workflow_dispatch: + push: branches: [ master ] pull_request: branches: [ master ] @@ -21,18 +22,21 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 + - name: Prepare pages run: ./prepare-pages.sh + - name: Deploy GitHub Pages + # Do not deploy PRs. + if: ${{ github.event_name != 'pull_request' }} run: | git worktree add gh-pages gh-pages - git config user.name "Deploy from CI" - git config user.email "" cd gh-pages # Delete the ref to avoid keeping history. git update-ref -d refs/heads/gh-pages rm -rf * mv ../output/* . git add . - git commit -m "Deploy $GITHUB_SHA to gh-pages" + git -c 'user.name=github-actions[bot]' -c 'user.email=41898282+github-actions[bot]@users.noreply.github.com' \ + commit -m "Deploy $GITHUB_SHA to gh-pages" git push --force