Skip to content

Commit

Permalink
Apply common workflows to existing workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
krzywon committed Mar 7, 2024
1 parent 5913f74 commit 0989fcd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 89 deletions.
49 changes: 4 additions & 45 deletions .github/workflows/pubs_add_new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,7 @@ on:
- cron: "0 * * * *"

jobs:
build:
name: "SasView Publications: Automated Check for New Publications"
runs-on: ubuntu-latest
steps:
- name: "A) Checkout saspubs Repository"
uses: actions/checkout@v2
with:
ssh-key: ${{ secrets.API_TOKEN_GITHUB }}
- name: "B) Setup Python"
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: "C) Install Python dependencies"
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools
python -m pip install -r ./build_tools/requirements.txt
- name: "D) Create publications list using the Zotero API"
run: python ./instrument_zotero_feed.py SASVIEW
- name: "E) Archive markdown file"
uses: actions/upload-artifact@v2
with:
name: SASVIEW_publications.md
path: ./static/
- name: "F) Checkout sasview.github.io Repository"
uses: actions/checkout@v2
with:
repository: sasview/sasview.github.io
ref: master
ssh-key: ${{ secrets.API_TOKEN_GITHUB }}
- name: "G) Download archived markdown file"
uses: actions/download-artifact@v2
with:
name: SASVIEW_publications.md
- name: "H) Copy Markdown File Back Into Workspace"
run: cp -f ./SASVIEW_publications.md ./publications.md
- name: "I) Commit And Push Any Changes to Github"
run: |
git diff
if ! git diff-index --quiet HEAD --; then
git config --global user.name ${{ secrets.GIT_USER_NAME }}
git config --global user.email ${{ secrets.GIT_EMAIL }}
git commit ./publications.md -m "publications auto-update `date -d now`"
git push
fi
call-workflow-start:
uses: ./.github/workflows/common_start.yml
call-workflow-end:
uses: ./.github/workflows/common_end.yml
50 changes: 6 additions & 44 deletions .github/workflows/pubs_checks_for_changes_and_duplications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,12 @@ on:
- cron: "0 0 * * *"

jobs:
build:
name: "SasView Publications: Automated Check for New Publications"
call-workflow-start:
uses: ./.github/workflows/common_start.yml
update-citations:
runs-on: ubuntu-latest
steps:
- name: "A) Checkout saspubs Repository"
uses: actions/checkout@v2
with:
ssh-key: ${{ secrets.API_TOKEN_GITHUB }}
- name: "B) Setup Python"
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: "C) Install Python dependencies"
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools
python -m pip install -r ./build_tools/requirements.txt
- name: "D) Create publications list using the Zotero API"
run: python ./instrument_zotero_feed.py SASVIEW
- name: "E) Look For Updates to Zotero List Using Citation Finder"
- name: "Look For Updates to Zotero List Using Citation Finder"
run: python ./update_current_list.py SASVIEW ${{ secrets.ZOTERO_KEY }}
- name: "F) Archive markdown file"
uses: actions/upload-artifact@v2
with:
name: SASVIEW_publications.md
path: ./static/
- name: "G) Checkout sasview.github.io Repository"
uses: actions/checkout@v2
with:
repository: sasview/sasview.github.io
ref: master
ssh-key: ${{ secrets.API_TOKEN_GITHUB }}
- name: "H) Download archived markdown file"
uses: actions/download-artifact@v2
with:
name: SASVIEW_publications.md
- name: "I) Copy Markdown File Back Into Workspace"
run: cp -f ./SASVIEW_publications.md ./publications.md
- name: "J) Commit And Push Any Changes to Github"
run: |
git diff
if ! git diff-index --quiet HEAD --; then
git config --global user.name ${{ secrets.GIT_USER_NAME }}
git config --global user.email ${{ secrets.GIT_EMAIL }}
git commit ./publications.md -m "publications auto-update `date -d now`"
git push
fi
call-workflow-end:
uses: ./.github/workflows/common_end.yml

0 comments on commit 0989fcd

Please sign in to comment.