Skip to content

deploy book via official actions #343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install mdbook
run: |
tag=$(curl -LsSf https://api.github.com/repos/rust-lang/mdBook/releases/latest | jq -r '.tag_name')
Expand All @@ -24,8 +24,25 @@ jobs:
run: |
git config --global http.postBuffer 50000000
git config --global https.postBuffer 50000000
- uses: rust-lang/simpleinfra/github-actions/static-websites@master
- name: Upload book artifacts
uses: actions/upload-pages-artifact@v3
with:
deploy_dir: book
github_token: ${{ secrets.GITHUB_TOKEN }}
path: book
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'rust-lang'

# Deploy is run as a separate job as it needs elevated permissions
deploy:
name: deploy
runs-on: ubuntu-latest
needs: test # the `test` job uploads the pages artifact
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'rust-lang'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
id: deployment