Skip to content

Commit 10cb608

Browse files
authored
Merge pull request #84 from ICPSR/rde_documentation
RDE metadata documentation
2 parents 5aed2f1 + 425fa46 commit 10cb608

100 files changed

Lines changed: 8156 additions & 1543 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/update_html.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ jobs:
1111
update_html:
1212
runs-on: ubuntu-latest
1313
name: Update HTML
14+
if: github.event.pull_request.merged == true # Only run if the PR was merged
1415

1516
steps:
1617
- name: Checkout repository
17-
uses: actions/checkout@v4
18+
uses: actions/checkout@v5
1819

1920
- name: Set up Python
20-
uses: actions/setup-python@v5
21+
uses: actions/setup-python@v6
2122
with:
2223
python-version: 3.11
2324

@@ -37,25 +38,24 @@ jobs:
3738

3839
deploy:
3940
runs-on: ubuntu-latest
40-
needs: update_html # Specify that this job depends on the completion of 'update_html'
41+
needs: update_html
4142
permissions:
4243
contents: read
4344
pages: write
4445
id-token: write
45-
46+
4647
steps:
4748
- name: Checkout
48-
uses: actions/checkout@v4
49+
uses: actions/checkout@v5
4950
with:
5051
ref: gh-pages
5152

5253
- name: Setup Pages
53-
uses: actions/configure-pages@v4
54+
uses: actions/configure-pages@v5
5455

5556
- name: Upload artifact
56-
uses: actions/upload-pages-artifact@v3
57+
uses: actions/upload-pages-artifact@v4
5758
with:
58-
# Upload entire repository
5959
path: '.'
6060

6161
- name: Deploy to GitHub Pages

.github/workflows/update_md.yaml

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- gh-pages
88
paths:
99
- 'schema/**'
10+
- 'rde_schema/**'
11+
- 'markdown/**'
1012

1113
jobs:
1214
update_markdown:
@@ -15,39 +17,61 @@ jobs:
1517

1618
steps:
1719
- name: Checkout repository
18-
uses: actions/checkout@v4
20+
uses: actions/checkout@v5
1921
with:
2022
fetch-depth: 0
2123

22-
- name: Get changed files in the schema folder
23-
id: changed-schema-specific
24-
uses: tj-actions/changed-files@v44
24+
- name: Get changed files in schema folder
25+
id: changed-schema
26+
uses: tj-actions/changed-files@v47
2527
with:
2628
files: schema/**
2729

28-
- name: Prevent from running if no schema files changed
29-
if: steps.changed-schema-specific.outputs.any_changed != 'true'
30-
run: exit 1
30+
- name: Get changed files in rde_schema folder
31+
id: changed-rde
32+
uses: tj-actions/changed-files@v47
33+
with:
34+
files: rde_schema/**
35+
36+
- name: Get changed files in markdown folder
37+
id: changed-markdown
38+
uses: tj-actions/changed-files@v47
39+
with:
40+
files: markdown/**
41+
42+
- name: Prevent running if no relevant files changed
43+
if: steps.changed-schema.outputs.any_changed != 'true' && steps.changed-rde.outputs.any_changed != 'true'
44+
run: echo "No relevant changes detected"
3145

3246
- name: Set up Python
33-
uses: actions/setup-python@v5
47+
uses: actions/setup-python@v6
3448
with:
3549
python-version: 3.11
3650

3751
- name: Install dependencies
3852
run: |
3953
pip install -r resources/requirements.txt
4054
41-
- name: Generate Schema Documentation
55+
- name: Generate Legacy Schema Documentation
56+
if: steps.changed-schema.outputs.any_changed == 'true' || steps.changed-markdown.outputs.any_changed == 'true'
57+
run: |
58+
python resources/generate_markdown.py \
59+
--input $GITHUB_WORKSPACE \
60+
--mode legacy
61+
62+
- name: Generate Current Schema Documentation
63+
if: steps.changed-rde.outputs.any_changed == 'true' || steps.changed-markdown.outputs.any_changed == 'true'
4264
run: |
43-
python resources/generate_markdown_schema.py --source-dir $GITHUB_WORKSPACE
65+
python resources/generate_markdown.py \
66+
--input $GITHUB_WORKSPACE \
67+
--mode current
4468
4569
- name: Commit and push changes
4670
run: |
4771
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
4872
git config user.name "${GITHUB_ACTOR}"
4973
git add markdown/
50-
git commit -am "Generated new copy of schema in markdown"
74+
git diff --cached --quiet || git commit -m "Generated new copy of schema in markdown"
5175
git push origin HEAD:$GITHUB_REF
5276
5377
- name: Deploy to GitHub Pages

.gitignore

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,16 @@ projects/terms_of_use/
88
projects/jinja_tests/export_request-*.json
99
projects/datacite/
1010
projects/ddi_doi_cleanup/input/
11-
projects/ddi_doi_cleanup/output
11+
projects/ddi_doi_cleanup/output
12+
rde_schema/property_bank/contributors.json
13+
rde_schema/property_bank/link_title.json
14+
rde_schema/property_bank/extent_of_processing.json
15+
rde_schema/property_bank/common_data_elements.json
16+
rde_schema/property_bank/deposits.json
17+
rde_schema/property_bank/restrictions.json
18+
rde_schema/property_bank/README.md
19+
rde_schema/property_bank/external_source_id.json
20+
rde_schema/property_bank/languages.json
21+
rde_schema/property_bank/oversamples.json
22+
rde_schema/property_bank/link_url.json
23+
rde_schema/property_bank/study_purpose.json

markdown/assets/style.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ a {
122122
}
123123

124124
.wy-side-nav-search {
125-
color: #ffffff;
126125
background-color: #115BFB;
127126
}
128127

0 commit comments

Comments
 (0)