-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (47 loc) · 1.52 KB
/
update_md.yaml
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
50
51
52
53
54
55
56
57
name: Update ICPSR Markdown
on:
push:
branches-ignore:
- main
- gh-pages
paths:
- 'schema/**'
jobs:
update_markdown:
runs-on: ubuntu-latest
name: Update Markdown
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files in the schema folder
id: changed-schema-specific
uses: tj-actions/changed-files@v44
with:
files: schema/**
- name: Prevent from running if no schema files changed
if: steps.changed-schema-specific.outputs.any_changed != 'true'
run: exit 1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install -r resources/requirements.txt
- name: Generate Schema Documentation
run: |
python resources/generate_markdown_schema.py --source-dir $GITHUB_WORKSPACE
- name: Commit and push changes
run: |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config user.name "${GITHUB_ACTOR}"
git add markdown/
git commit -am "Generated new copy of schema in markdown"
git push origin HEAD:$GITHUB_REF
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site