|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - master |
7 | | - |
| 7 | + |
8 | 8 | jobs: |
9 | 9 | build-and-deploy: |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 | permissions: |
12 | 12 | contents: write |
13 | 13 | name: Build site |
14 | 14 | steps: |
15 | | - - name: Checkout |
16 | | - uses: actions/checkout@v2 |
17 | | - with: |
18 | | - fetch-depth: 0 |
19 | | - |
20 | | - - uses: szenius/set-timezone@v1.0 |
21 | | - with: |
22 | | - timezoneLinux: "Asia/Shanghai" |
23 | | - |
24 | | - - name: Check Time |
25 | | - run: date |
26 | | - |
27 | | - - uses: actions/setup-node@v2 |
28 | | - with: |
29 | | - node-version: '16' |
30 | | - |
31 | | - - name: Check yarn / node version |
32 | | - run: | |
33 | | - echo "yarn version `yarn --version`" |
34 | | - echo "node version `node -v`" |
35 | | -
|
36 | | - - name: Cache dependencies |
37 | | - uses: actions/cache@v2 |
38 | | - with: |
39 | | - path: ~/.npm |
40 | | - key: npm-${{ hashFiles('package-lock.json') }} |
41 | | - restore-keys: npm- |
42 | | - |
43 | | - - name: Install Dependencies |
44 | | - run: yarn install |
45 | | - |
46 | | - - name: Build Site |
47 | | - run: yarn build |
48 | | - |
49 | | - - name: Deploy to GitHub page |
50 | | - uses: peaceiris/actions-gh-pages@v3 |
51 | | - with: |
52 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
53 | | - publish_dir: ./site/.vuepress/dist/ |
54 | | - publish_branch: static-site |
55 | | - force_orphan: true |
56 | | - |
57 | | -# build-and-deploy: |
58 | | -# runs-on: ubuntu-latest |
59 | | -# steps: |
60 | | -# - name: Checkout |
61 | | -# uses: actions/checkout@master |
62 | | -# with: |
63 | | -# fetch-depth: 0 |
64 | | - |
65 | | -# - name: vuepress-deploy |
66 | | -# uses: jenkey2011/vuepress-deploy@1.0.1 |
67 | | -# env: |
68 | | -# ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} |
69 | | -# TARGET_REPO: SUSTech-CRA/ccse-mirrors-web |
70 | | -# TARGET_BRANCH: static-site |
71 | | -# BUILD_SCRIPT: yarn && yarn build |
72 | | -# BUILD_DIR: site/.vuepress/dist/ |
73 | | -# TZ: Asia/Shanghai |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + |
| 20 | + - uses: szenius/set-timezone@v1.0 |
| 21 | + with: |
| 22 | + timezoneLinux: "Asia/Shanghai" |
| 23 | + |
| 24 | + - name: Check Time |
| 25 | + run: date |
| 26 | + |
| 27 | + - uses: actions/setup-node@v4 |
| 28 | + with: |
| 29 | + node-version: '16' |
| 30 | + |
| 31 | + - name: Check yarn / node version |
| 32 | + run: | |
| 33 | + echo "yarn version $(yarn --version)" |
| 34 | + echo "node version $(node -v)" |
| 35 | +
|
| 36 | + - name: Cache dependencies |
| 37 | + uses: actions/cache@v3 |
| 38 | + with: |
| 39 | + path: ~/.npm |
| 40 | + key: npm-${{ hashFiles('package-lock.json') }} |
| 41 | + restore-keys: npm- |
| 42 | + |
| 43 | + - name: Install Dependencies |
| 44 | + run: yarn install |
| 45 | + |
| 46 | + - name: Build Site |
| 47 | + run: yarn build |
| 48 | + |
| 49 | + - name: Deploy to GitHub Pages |
| 50 | + uses: peaceiris/actions-gh-pages@v3 |
| 51 | + with: |
| 52 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + publish_dir: ./site/.vuepress/dist/ |
| 54 | + publish_branch: static-site |
| 55 | + force_orphan: true |
0 commit comments