|
6 | 6 | - main
|
7 | 7 | paths:
|
8 | 8 | - ".github/workflows/docs.yml"
|
9 |
| - - ".github/scripts/deploy-docs.sh" |
| 9 | + - ".github/scripts/deploy-404.sh" |
10 | 10 | - "requirements-docs.txt"
|
11 | 11 | - "mkdocs.yml"
|
12 | 12 | - "docs/**"
|
|
15 | 15 | - main
|
16 | 16 | paths:
|
17 | 17 | - ".github/workflows/docs.yml"
|
18 |
| - - ".github/scripts/deploy-docs.sh" |
| 18 | + - ".github/scripts/deploy-404.sh" |
19 | 19 | - "requirements-docs.txt"
|
20 | 20 | - "mkdocs.yml"
|
21 | 21 | - "docs/**"
|
|
36 | 36 | - name: Checkout Code
|
37 | 37 | uses: actions/checkout@v4
|
38 | 38 | with:
|
| 39 | + token: ${{ secrets.GITHUB_TOKEN }} |
39 | 40 | fetch-depth: 0
|
40 | 41 |
|
41 | 42 | - name: Configure Git Credentials
|
@@ -66,16 +67,13 @@ jobs:
|
66 | 67 | - name: Deploy development version from main branch
|
67 | 68 | if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
68 | 69 | run: |
|
69 |
| - # Use the short commit hash as the version name for dev builds |
70 |
| - echo "MIKE_VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
71 |
| - echo "Deploying docs from main commit ${{ env.MIKE_VERSION }} to 'dev' and 'latest' aliases..." |
72 |
| - mike deploy --push --update-aliases "${{ env.MIKE_VERSION }}" dev latest |
| 70 | + mike deploy --push --update-aliases dev latest |
73 | 71 |
|
74 | 72 | echo "Setting 'latest' as the default version for the site..."
|
75 | 73 | mike set-default --push latest
|
76 | 74 |
|
77 | 75 | # Deploy 404 page
|
78 |
| - bash .github/scripts/deploy-docs.sh ${{ github.repository }} |
| 76 | + bash .github/scripts/deploy-404.sh ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} |
79 | 77 |
|
80 | 78 | - name: Deploy new release version and set as latest
|
81 | 79 | if: github.event_name == 'release'
|
|
88 | 86 | echo "Setting 'latest' as the default version for the site..."
|
89 | 87 | mike set-default --push latest
|
90 | 88 |
|
91 |
| - # Deploy 404 page |
92 |
| - bash .github/scripts/deploy-docs.sh ${{ github.repository }} |
| 89 | + # Call the reusable script to deploy the 404 page, passing the token |
| 90 | + bash .github/scripts/deploy-404.sh ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} |
0 commit comments