Added another article #69
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: When citation added, update frontmatter | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- downstream/citedin_lookup.yml | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
frontmatter: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
ref: main | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install deps | |
run: | | |
pip install python-frontmatter | |
- name: Update citedin in frontmatter .md files | |
run: | | |
python ./scripts/update_frontmatter_citedin.py | |
- name: Commit report | |
run: | | |
git config --global user.name 'GitHub Action' | |
git config --global user.email '[email protected]' | |
git add pathways/*/*.md | |
if git diff --exit-code --staged; then | |
echo "No changes" | |
else | |
git commit -m 'Update citedin in frontmatter .md files' | |
git pull --rebase | |
git push | |
fi | |
copy-to-site-repo: | |
runs-on: ubuntu-latest | |
needs: [frontmatter] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: wikipathways-database | |
submodules: true | |
fetch-depth: 0 | |
ref: main | |
- name: Checkout jekyll repo | |
uses: actions/checkout@v4 | |
with: | |
repository: wikipathways/wikipathways.github.io | |
path: wikipathways.github.io | |
submodules: true | |
fetch-depth: 0 | |
ref: main | |
ssh-key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
- name: Commit report | |
run: | | |
git config --global user.name 'GitHub Action' | |
git config --global user.email '[email protected]' | |
cp wikipathways-database/pathways/*/*.md wikipathways.github.io/_pathways/ | |
cd wikipathways.github.io | |
git add _pathways/*.md | |
if git diff --exit-code --staged > /dev/null; then | |
echo "No changes" | |
else | |
git diff --name-only | |
git commit -m 'Update citedin in frontmatter .md files' | |
git pull --rebase | |
git push | |
fi |