Skip to content

Commit 159d08a

Browse files
committed
1 parent c5d4490 commit 159d08a

File tree

1 file changed

+71
-69
lines changed

1 file changed

+71
-69
lines changed

.github/workflows/pr-check.yml

Lines changed: 71 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,71 @@
1-
name: PR Check
2-
3-
on:
4-
pull_request:
5-
branches: ['main']
6-
7-
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
8-
permissions:
9-
contents: read
10-
pages: write
11-
id-token: write
12-
13-
# Allow one concurrent deployment
14-
concurrency:
15-
group: 'pages'
16-
cancel-in-progress: false
17-
18-
jobs:
19-
build:
20-
runs-on: ubuntu-latest
21-
steps:
22-
- name: Checkout
23-
uses: actions/checkout@v4
24-
- name: Set up Node
25-
uses: actions/setup-node@v4
26-
with:
27-
node-version: 20
28-
cache: 'npm'
29-
- name: Install dependencies
30-
run: npm ci
31-
- name: Build
32-
run: npm run build
33-
- name: Setup Pages
34-
uses: actions/configure-pages@v4
35-
- name: Upload artifact
36-
uses: actions/upload-pages-artifact@v3
37-
with:
38-
path: './dist'
39-
- name: Deploy to GitHub Pages
40-
id: deployment
41-
uses: actions/deploy-pages@v4
42-
43-
pr-deploy:
44-
if: github.event_name == 'pull_request'
45-
environment:
46-
name: github-pages-pr-${{ github.event.pull_request.number }}
47-
url: ${{ steps.deployment.outputs.page_url }}
48-
runs-on: ubuntu-latest
49-
steps:
50-
- name: Checkout
51-
uses: actions/checkout@v4
52-
- name: Set up Node
53-
uses: actions/setup-node@v4
54-
with:
55-
node-version: 20
56-
cache: 'npm'
57-
- name: Install dependencies
58-
run: npm ci
59-
- name: Build
60-
run: npm run build
61-
- name: Setup Pages
62-
uses: actions/configure-pages@v4
63-
- name: Upload artifact
64-
uses: actions/upload-pages-artifact@v3
65-
with:
66-
path: './dist'
67-
- name: Deploy to GitHub Pages
68-
id: deployment
69-
uses: actions/deploy-pages@v4
1+
1 name: PR Check
2+
2
3+
3 on:
4+
4 pull_request:
5+
5 branches: ['main']
6+
6
7+
7 # Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
8+
8 permissions:
9+
9 contents: read
10+
10 pages: write
11+
11 id-token: write
12+
12
13+
13 # Allow one concurrent deployment
14+
14 concurrency:
15+
15 group: 'pages'
16+
16 cancel-in-progress: false
17+
17
18+
18 jobs:
19+
19 build:
20+
20 runs-on: ubuntu-latest
21+
21 steps:
22+
22 - name: Checkout
23+
23 uses: actions/checkout@v4
24+
24 - name: Set up Node
25+
25 uses: actions/setup-node@v4
26+
26 with:
27+
27 node-version: 20
28+
28 cache: 'npm'
29+
29 - name: Install dependencies
30+
30 run: npm ci
31+
31 - name: Build
32+
32 run: npm run build
33+
33 - name: Setup Pages
34+
34 uses: actions/configure-pages@v4
35+
35 - name: Upload artifact
36+
36 uses: actions/upload-pages-artifact@v3
37+
37 with:
38+
38 path: './dist'
39+
39 - name: Deploy to GitHub Pages
40+
40 id: deployment
41+
41 uses: actions/deploy-pages@v4
42+
42
43+
43 pr-deploy:
44+
44 if: github.event_name == 'pull_request'
45+
45 environment:
46+
46 name: github-pages-pr-${{ github.event.pull_request.number }}
47+
47 url: ${{ steps.deployment.outputs.page_url }}
48+
48 runs-on: ubuntu-latest
49+
49 steps:
50+
50 - name: Checkout
51+
51 uses: actions/checkout@v4
52+
52 - name: Set up Node
53+
53 uses: actions/setup-node@v4
54+
54 with:
55+
55 node-version: 20
56+
56 cache: 'npm'
57+
57 - name: Install dependencies
58+
58 run: npm ci
59+
59 - name: Build
60+
60 run: npm run build
61+
61 - name: Setup Pages
62+
62 uses: actions/configure-pages@v4
63+
63 - name: Delete existing artifact
64+
64 run: rm -rf ./dist
65+
65 - name: Upload artifact
66+
66 uses: actions/upload-pages-artifact@v3
67+
67 with:
68+
68 path: './dist'
69+
69 - name: Deploy to GitHub Pages
70+
70 id: deployment
71+
71 uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)