Skip to content

Update CPTAC.txt

Update CPTAC.txt #61

name: When community changed, update frontmatter
on:
workflow_dispatch:
push:
branches:
- main
paths:
- communities/*.txt
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: Install SSH Client 🔑
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.ACTIONS_DEPLOY_KEY }} ## for push into cookbook-dev
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install deps
run: |
pip install python-frontmatter
- name: Update communities in frontmatter .md files
run: |
python ./scripts/update_frontmatter_communities.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 communities 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: Install SSH Client 🔑
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.ACTIONS_DEPLOY_KEY }} ## for push into cookbook-dev
- 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 communities in frontmatter .md files'
git pull --rebase
git push
fi