← 返回列表

Commit eda309e

单站 github.com 入库 2026-11-18T04:33:30

| |
| 6 | 6 | pull_request: |
| 7 | 7 | branches: [ master ] |
| 8 | 8 | |
| | 9 | + permissions: |
| | 10 | + contents: read |
| | 11 | + pages: write |
| | 12 | + id-token: write |
| | 13 | + |
| 9 | 14 | jobs: |
| 10 | 15 | build: |
| 11 | 16 | runs-on: ubuntu-latest |
| 12 | | - |
| | 17 | + environment: |
| | 18 | + name: github-pages |
| | 19 | + url: ${{ steps.deployment.outputs.page_url }} |
| | 20 | + |
| 13 | 21 | steps: |
| 14 | | - - uses: actions/checkout@v2 |
| | 22 | + - uses: actions/checkout@v4 |
| 15 | 23 | - name: Use Node.js |
| 16 | | - uses: actions/setup-node@v1 |
| | 24 | + uses: actions/setup-node@v4 |
| | 25 | + with: |
| | 26 | + node-version: '20' |
| 17 | 27 | - name: Get yarn cache directory path |
| 18 | 28 | id: yarn-cache-dir-path |
| 19 | | - run: echo "::set-output name=dir::$(yarn cache dir)" |
| 20 | | - - uses: actions/cache@v2 |
| | 29 | + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT |
| | 30 | + - uses: actions/cache@v4 |
| 21 | 31 | id: yarn-cache # use this to check for cache-hit (steps.yarn-cache.outputs.cache-hit != 'true') |
| 22 | 32 | with: |
| 23 | 33 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| @@ -28,11 +38,14 @@ jobs: |
| 28 | 38 | - run: sed -i 's/GITHUB_ClientId/${{ secrets.CLIENTID }}/g' docs/.vuepress/config.js |
| 29 | 39 | - run: sed -i 's/GITHUB_ClientSecret/${{ secrets.CLIENTSECRET }}/g' docs/.vuepress/config.js |
| 30 | 40 | - run: yarn run build |
| 31 | | - - name: Deploy |
| 32 | | - uses: peaceiris/actions-gh-pages@v3 |
| | 41 | + - name: Add CNAME file |
| | 42 | + run: echo "wiki.wgpsec.org" > ./public/CNAME |
| | 43 | + - name: Setup Pages |
| | 44 | + uses: actions/configure-pages@v4 |
| | 45 | + - name: Upload artifact |
| | 46 | + uses: actions/upload-pages-artifact@v3 |
| 33 | 47 | with: |
| 34 | | - publish_dir: ./public |
| 35 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
| 36 | | - user_name: 'WgpSec Continuous Integration' |
| 37 | | - user_email: 'ci@wgpsec.org' |
| 38 | | - cname: wiki.wgpsec.org |
| | 48 | + path: ./public |
| | 49 | + - name: Deploy to GitHub Pages |
| | 50 | + id: deployment |
| | 51 | + uses: actions/deploy-pages@v4 |

原文链接:https://github.com/wgpsec/wiki/commit/eda309e2dc1528e84c269a5ac8a17a8eba05ebb2