-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (45 loc) · 1.46 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Publish JD
on: ["pull_request", "push"]
env:
DEST_DIR: _out
PYTHON_VERSION: "3.10"
jobs:
build:
# Only run on PRs if the source branch is on someone else's repo
if: "${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}"
runs-on: "ubuntu-22.04"
steps:
- name: "checkout repository"
uses: "actions/checkout@v3"
- name: "setup python ${{ env.PYTHON_VERSION }}"
uses: "actions/setup-python@v4"
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: "install dependencies"
run: |
pip install poetry
pushd _generator
poetry install
- name: "generate site"
run: |
pushd _generator
poetry run generate-jd ../$DEST_DIR --metadata ../metadata.yaml --jd-root ..
- name: "publish"
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/data' }}"
uses: "actions/upload-pages-artifact@v1"
with:
path: "${{ env.DEST_DIR }}"
deploy:
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/data' }}"
needs: "build"
runs-on: "ubuntu-22.04"
permissions:
pages: "write"
id-token: "write"
environment:
name: "github-pages"
url: "${{ steps.deployment.outputs.page_url }}"
steps:
- name: "Deploy to GitHub pages"
id: "deployment"
uses: "actions/deploy-pages@v1"