Skip to content

Commit

Permalink
ci: use actions/deploy pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed May 12, 2024
1 parent 1ca4894 commit 9596359
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ jobs:

rustdoc:
runs-on: windows-latest
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master'
needs: [build]
steps:
- name: Before checking out source and change \n -> \r\n
run: |
Expand All @@ -106,24 +102,28 @@ jobs:
rustup default nightly
- run: cargo doc --all --no-deps # --document-private-items
- run: echo '<meta http-equiv=refresh content=0;url=junction/index.html>' > target/doc/index.html
- name: Commit docs to gh-pages branch
working-directory: target/doc
run: |
# Bypassing Jekyll on GitHub Pages
touch .nojekyll
REV=$(git rev-parse --short HEAD)
git init
git config user.name "Actions"
git config user.email ""
git add -A .
# git add --renormalize .
git commit -qm "Documentation for ${{github.repository}}@${REV}"
shell: bash
- name: Push gh-pages to GitHub
working-directory: target/doc
run: |
git remote add upstream https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git push -q upstream HEAD:gh-pages --force
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: target/doc

deploy:
# if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master'
if: github.event_name != 'pull_request'
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: [rustdoc]
runs-on: windows-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

clippy:
runs-on: windows-latest
Expand Down

0 comments on commit 9596359

Please sign in to comment.