|
1 | 1 | # Simple workflow for deploying static content to GitHub Pages |
2 | | -name: Deploy static content to Pages |
| 2 | +name: Deploy Pages |
3 | 3 |
|
| 4 | +# Controls when the action will run. |
4 | 5 | on: |
5 | | - # Runs on pushes targeting the default branch |
6 | | - push: |
7 | | - branches: ["main"] |
8 | 6 |
|
9 | | - # Allows you to run this workflow manually from the Actions tab |
| 7 | + # Trigger the deployment manually |
10 | 8 | workflow_dispatch: |
11 | 9 |
|
| 10 | + # Trigger the deployment on push to the main branch |
| 11 | + push: |
| 12 | + |
| 13 | + # Only the main branch |
| 14 | + branches: |
| 15 | + - "main" |
| 16 | + |
| 17 | + # Only when the docs directory or mkdocs.yml file changes |
| 18 | + paths: |
| 19 | + - "docs/**" |
| 20 | + - mkdocs.yml |
| 21 | + |
12 | 22 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
13 | 23 | permissions: |
14 | 24 | contents: read |
15 | 25 | pages: write |
16 | 26 | id-token: write |
17 | 27 |
|
18 | | -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
19 | | -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 28 | +# Allow one concurrent deployment |
20 | 29 | concurrency: |
21 | 30 | group: "pages" |
22 | | - cancel-in-progress: false |
| 31 | + cancel-in-progress: true |
23 | 32 |
|
| 33 | +# Define the jobs that run in the workflow |
24 | 34 | jobs: |
25 | | - # Single deploy job since we're just deploying |
| 35 | + |
| 36 | + # The build job |
| 37 | + build: |
| 38 | + runs-on: ubuntu-latest |
| 39 | + steps: |
| 40 | + - name: Checkout |
| 41 | + uses: actions/checkout@v3 |
| 42 | + - run: ls -la |
| 43 | + - name: Setup Pages |
| 44 | + uses: actions/configure-pages@v2 |
| 45 | + - name: Setup Python, install plugins, and build site |
| 46 | + uses: actions/setup-python@v4 |
| 47 | + with: |
| 48 | + python-version: 3.x |
| 49 | + - run: pip install mkdocs |
| 50 | + - run: pip install mkdocs-section-index |
| 51 | + - run: mkdocs build --site-dir ./_site |
| 52 | + - name: Upload artifact |
| 53 | + uses: actions/upload-pages-artifact@v1 |
| 54 | + |
| 55 | + # The deployment job |
26 | 56 | deploy: |
27 | 57 | environment: |
28 | 58 | name: github-pages |
29 | 59 | url: ${{ steps.deployment.outputs.page_url }} |
30 | 60 | runs-on: ubuntu-latest |
| 61 | + needs: build |
31 | 62 | steps: |
32 | | - - name: Checkout |
33 | | - uses: actions/checkout@v4 |
34 | | - - name: Setup Pages |
35 | | - uses: actions/configure-pages@v5 |
36 | | - - name: Upload artifact |
37 | | - uses: actions/upload-pages-artifact@v3 |
38 | | - with: |
39 | | - # Upload entire repository |
40 | | - path: '.' |
41 | 63 | - name: Deploy to GitHub Pages |
42 | 64 | id: deployment |
43 | | - uses: actions/deploy-pages@v4 |
| 65 | + uses: actions/deploy-pages@v1 |
0 commit comments