|
1 | | -# This is a basic workflow to help you get started with Actions |
| 1 | +name: Deploy mdBook site to Pages |
2 | 2 |
|
3 | | -name: Auto gh-pages Deploy |
4 | | - |
5 | | -# Controls when the action will run. |
6 | 3 | on: |
7 | 4 | push: |
8 | | - branches: [ master ] |
9 | | - |
10 | | - # Allows you to run this workflow manually from the Actions tab |
11 | | - workflow_dispatch: |
| 5 | + branches: [main] |
| 6 | + workflow_dispatch: # Allows you to run this workflow manually from the Actions tab |
| 7 | + pull_request: |
| 8 | + |
| 9 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + pages: write |
| 13 | + id-token: write |
| 14 | + |
| 15 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 16 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 17 | +concurrency: |
| 18 | + group: pages |
| 19 | + cancel-in-progress: false |
12 | 20 |
|
13 | | -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
14 | 21 | jobs: |
15 | | - # This workflow contains a single job called "build" |
16 | 22 | build: |
17 | | - # The type of runner that the job will run on |
18 | | - runs-on: ubuntu-latest |
19 | | - |
20 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
| 23 | + runs-on: ubuntu-24.04 |
21 | 24 | steps: |
22 | | - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
23 | | - - uses: actions/checkout@v2 |
24 | | - |
25 | | - - name: Setup mdBook |
26 | | - uses: peaceiris/actions-mdbook@v1 |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + - uses: peaceiris/actions-mdbook@v2 |
27 | 27 | with: |
28 | | - mdbook-version: 'latest' |
29 | | - |
30 | | - - name: Build mdbook |
31 | | - run: mdbook build |
32 | | - |
33 | | - - name: Deploy gh-pages |
34 | | - uses: peaceiris/actions-gh-pages@v3 |
| 28 | + mdbook-version: latest |
| 29 | + - id: pages |
| 30 | + uses: actions/configure-pages@v5 |
| 31 | + - run: mdbook build |
| 32 | + - uses: actions/upload-pages-artifact@v3 |
35 | 33 | with: |
36 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
37 | | - publish_dir: ./book |
38 | | - user_name: 'github-actions[bot]' |
39 | | - user_email: 'github-actions[bot]@users.noreply.github.com' |
40 | | - commit_message: 'Auto Deploy (${{ github.event.head_commit.message }})' |
41 | | - cname: doc.rust-kr.org |
| 34 | + path: ./book |
| 35 | + |
| 36 | + deploy: |
| 37 | + environment: |
| 38 | + name: github-pages |
| 39 | + url: ${{ steps.deployment.outputs.page_url }} |
| 40 | + runs-on: ubuntu-24.04 |
| 41 | + needs: build |
| 42 | + steps: |
| 43 | + - id: deployment |
| 44 | + uses: actions/deploy-pages@v4 |
0 commit comments