Skip to content

Commit 1a30cfd

Browse files
authored
Update static-site.yml to cache v3+
1 parent babbbc1 commit 1a30cfd

File tree

1 file changed

+42
-60
lines changed

1 file changed

+42
-60
lines changed

.github/workflows/static-site.yml

Lines changed: 42 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -4,70 +4,52 @@ on:
44
push:
55
branches:
66
- master
7-
7+
88
jobs:
99
build-and-deploy:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: write
1313
name: Build site
1414
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

Comments
 (0)