|
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: |
8 | 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 | + |
9 | 16 | jobs: |
10 | 17 | build: |
11 | | - name: Build and Deploy |
| 18 | + name: Build |
12 | 19 | runs-on: ubuntu-latest |
13 | 20 | steps: |
14 | | - - uses: actions/setup-node@v3 |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v4 |
15 | 23 | with: |
16 | | - node-version: 16 |
17 | | - - name: Checkout Repository |
18 | | - uses: actions/checkout@v3 |
19 | | - # with: |
20 | | - # persist-credentials: false |
21 | | - - name: Install |
22 | | - run: npm ci |
| 24 | + submodules: 'recursive' |
| 25 | + - name: Setup Node |
| 26 | + uses: actions/setup-node@v4 |
| 27 | + with: |
| 28 | + node-version: '22' |
| 29 | + cache: 'yarn' |
| 30 | + cache-dependency-path: ./yarn.lock |
| 31 | + - name: Install Dependencies |
| 32 | + run: yarn install --frozen-lockfile |
23 | 33 | - name: Build |
24 | | - run: npm run build |
25 | | - - name: Deploy |
26 | | - uses: JamesIves/github-pages-deploy-action@v4.4.0 |
27 | | - 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 |
28 | 37 | with: |
29 | | - token: ${{ secrets.ACCESS_TOKEN }} |
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 |
32 | 50 |
|
33 | 51 | lint: |
34 | 52 | name: Lint |
35 | 53 | runs-on: ubuntu-latest |
36 | 54 | steps: |
37 | | - - uses: actions/setup-node@v3 |
38 | | - with: |
39 | | - node-version: 16 |
40 | 55 | - name: Checkout Repository |
41 | | - uses: actions/checkout@v3 |
| 56 | + uses: actions/checkout@v4 |
| 57 | + - uses: actions/setup-node@v4 |
| 58 | + with: |
| 59 | + node-version: '22' |
| 60 | + cache: 'yarn' |
| 61 | + cache-dependency-path: ./yarn.lock |
42 | 62 | - name: Install |
43 | | - run: npm ci |
| 63 | + run: yarn install --frozen-lockfile |
44 | 64 | - name: Lint |
45 | | - run: npm run lint-ci |
| 65 | + run: yarn run lint-ci |
0 commit comments