|
1 | 1 | name: Build/Test/Deploy |
2 | 2 | on: |
3 | 3 | push: |
4 | | - branches-ignore: |
5 | | - - gh-pages |
6 | 4 | workflow_dispatch: |
7 | 5 | pull_request: |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + pages: write |
| 10 | + id-token: write |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: "pages" |
| 14 | + cancel-in-progress: false |
| 15 | + |
8 | 16 | jobs: |
9 | 17 | build: |
10 | | - name: Build and Deploy |
| 18 | + name: Build |
11 | 19 | runs-on: ubuntu-latest |
12 | 20 | steps: |
13 | | - - uses: actions/setup-node@v2-beta |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v4 |
14 | 23 | with: |
15 | | - node-version: '12' |
16 | | - - name: Checkout Repository |
17 | | - uses: actions/checkout@v2 |
| 24 | + submodules: 'recursive' |
| 25 | + - name: Setup Node |
| 26 | + uses: actions/setup-node@v4 |
18 | 27 | with: |
19 | | - fetch-depth: '0' |
20 | | - - name: Install |
21 | | - run: npm install |
| 28 | + node-version: '22' |
| 29 | + cache: 'yarn' |
| 30 | + cache-dependency-path: ./yarn.lock |
| 31 | + - name: Install Dependencies |
| 32 | + run: yarn install --frozen-lockfile |
22 | 33 | - name: Build |
23 | | - run: npm run build |
24 | | - - name: Deploy |
25 | | - |
26 | | - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master'}} |
| 34 | + run: yarn run build |
| 35 | + - name: Upload artifact |
| 36 | + uses: actions/upload-pages-artifact@v3 |
27 | 37 | with: |
28 | | - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} |
29 | | - BRANCH: gh-pages |
30 | | - FOLDER: .vuepress/dist/ |
31 | | - CLEAN: true |
| 38 | + path: .vuepress/dist/ |
| 39 | + deploy: |
| 40 | + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} |
| 41 | + environment: |
| 42 | + name: github-pages |
| 43 | + url: ${{ steps.deployment.outputs.page_url }} |
| 44 | + runs-on: ubuntu-latest |
| 45 | + needs: build |
| 46 | + steps: |
| 47 | + - name: Deploy to GitHub Pages |
| 48 | + id: deployment |
| 49 | + uses: actions/deploy-pages@v4 |
| 50 | + |
32 | 51 | lint: |
33 | 52 | name: Lint |
34 | 53 | runs-on: ubuntu-latest |
35 | 54 | steps: |
36 | | - - uses: actions/setup-node@v2-beta |
37 | | - with: |
38 | | - node-version: '12' |
39 | 55 | - name: Checkout Repository |
40 | | - uses: actions/checkout@v2 |
| 56 | + uses: actions/checkout@v4 |
| 57 | + - uses: actions/setup-node@v4 |
41 | 58 | with: |
42 | | - fetch-depth: '0' |
| 59 | + node-version: '22' |
| 60 | + cache: 'yarn' |
| 61 | + cache-dependency-path: ./yarn.lock |
43 | 62 | - name: Install |
44 | | - run: npm install |
| 63 | + run: yarn install --frozen-lockfile |
45 | 64 | - name: Lint |
46 | | - run: npm run lint-ci |
| 65 | + run: yarn run lint-ci |
| 66 | + |
47 | 67 | spellcheck: |
48 | 68 | name: Spellcheck |
49 | 69 | runs-on: ubuntu-latest |
50 | 70 | steps: |
51 | | - - uses: actions/setup-node@v2-beta |
52 | | - with: |
53 | | - node-version: '12' |
54 | 71 | - name: Checkout Repository |
55 | | - uses: actions/checkout@v2 |
| 72 | + uses: actions/checkout@v4 |
| 73 | + - uses: actions/setup-node@v4 |
56 | 74 | with: |
57 | | - fetch-depth: '0' |
| 75 | + node-version: '22' |
| 76 | + cache: 'yarn' |
| 77 | + cache-dependency-path: ./yarn.lock |
58 | 78 | - name: Install |
59 | | - run: npm install |
| 79 | + run: yarn install --frozen-lockfile |
60 | 80 | - name: Spellcheck |
61 | | - run: npm run spellcheck |
| 81 | + run: yarn run spellcheck |
0 commit comments