Skip to content

Commit cdcd222

Browse files
committed
ci(deploy-test.yml): add deploy test on PR
1 parent 0f712f3 commit cdcd222

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/deploy-test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy Test
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Setup Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: 3.x
19+
20+
- name: Cache dependencies
21+
uses: actions/cache@v3
22+
with:
23+
key: mkdocs-material-${{ runner.os }}-${{ hashFiles('**/requirements.txt') }}
24+
path: .cache
25+
26+
- name: Install dependencies
27+
run: |
28+
pip3 install -U -r requirements.txt
29+
30+
- name: Build site
31+
run: mkdocs build
32+
33+
- name: Check Deployment
34+
run: |
35+
if [ -d "site" ]; then
36+
echo "Deploy would have succeeded!"
37+
else
38+
echo "Deploy would have failed!"
39+
gh pr close ${{ github.event.pull_request.number }}
40+
exit 1
41+
fi

0 commit comments

Comments
 (0)