Skip to content

Commit

Permalink
ci(deploy-test.yml): add deploy test on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanWonghere committed Jul 20, 2024
1 parent 0f712f3 commit cdcd222
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy Test

on:
pull_request:
branches: [master]

jobs:

build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Cache dependencies
uses: actions/cache@v3
with:
key: mkdocs-material-${{ runner.os }}-${{ hashFiles('**/requirements.txt') }}
path: .cache

- name: Install dependencies
run: |
pip3 install -U -r requirements.txt
- name: Build site
run: mkdocs build

- name: Check Deployment
run: |
if [ -d "site" ]; then
echo "Deploy would have succeeded!"
else
echo "Deploy would have failed!"
gh pr close ${{ github.event.pull_request.number }}
exit 1
fi

0 comments on commit cdcd222

Please sign in to comment.