Skip to content

Commit 09346b4

Browse files
authored
Merge pull request #20 from dortania/update-ci
2 parents f2d0f83 + 9352918 commit 09346b4

File tree

3 files changed

+9976
-33
lines changed

3 files changed

+9976
-33
lines changed
Lines changed: 52 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,81 @@
11
name: Build/Test/Deploy
22
on:
33
push:
4-
branches-ignore:
5-
- gh-pages
64
workflow_dispatch:
75
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+
816
jobs:
917
build:
10-
name: Build and Deploy
18+
name: Build
1119
runs-on: ubuntu-latest
1220
steps:
13-
- uses: actions/setup-node@v2-beta
21+
- name: Checkout
22+
uses: actions/checkout@v4
1423
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
1827
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
2233
- name: Build
23-
run: npm run build
24-
- name: Deploy
25-
uses: JamesIves/[email protected]
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
2737
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+
3251
lint:
3352
name: Lint
3453
runs-on: ubuntu-latest
3554
steps:
36-
- uses: actions/setup-node@v2-beta
37-
with:
38-
node-version: '12'
3955
- name: Checkout Repository
40-
uses: actions/checkout@v2
56+
uses: actions/checkout@v4
57+
- uses: actions/setup-node@v4
4158
with:
42-
fetch-depth: '0'
59+
node-version: '22'
60+
cache: 'yarn'
61+
cache-dependency-path: ./yarn.lock
4362
- name: Install
44-
run: npm install
63+
run: yarn install --frozen-lockfile
4564
- name: Lint
46-
run: npm run lint-ci
65+
run: yarn run lint-ci
66+
4767
spellcheck:
4868
name: Spellcheck
4969
runs-on: ubuntu-latest
5070
steps:
51-
- uses: actions/setup-node@v2-beta
52-
with:
53-
node-version: '12'
5471
- name: Checkout Repository
55-
uses: actions/checkout@v2
72+
uses: actions/checkout@v4
73+
- uses: actions/setup-node@v4
5674
with:
57-
fetch-depth: '0'
75+
node-version: '22'
76+
cache: 'yarn'
77+
cache-dependency-path: ./yarn.lock
5878
- name: Install
59-
run: npm install
79+
run: yarn install --frozen-lockfile
6080
- name: Spellcheck
61-
run: npm run spellcheck
81+
run: yarn run spellcheck

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ node_modules/
44
.DS_Store
55
package-lock.json
66
.vuepress/dist
7-
yarn.lock

0 commit comments

Comments
 (0)