Skip to content

add workflow_run

add workflow_run #169

name: Update website content
on:
push:
branches:
- 'main'
- 'test_website'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
update_content:
runs-on: ubuntu-latest
env:
UPDATE_BRANCH_NAME: "auto_update_content_${{ github.run_number }}"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
path: openproblems
- name: Checkout website repo
uses: actions/checkout@v3
with:
fetch-depth: 1
repository: openproblems-bio/website
ref: main
path: website
token: ${{ secrets.GH_ACTIONS_WEBSITE_PAT }}
- name: Set up website Git branch
working-directory: website
run: |
git checkout -b $UPDATE_BRANCH_NAME
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install package & dependencies
run: |
python -m pip install --upgrade pip
pip install -U wheel setuptools
pip install -U --editable ./openproblems[process]
python -c "import openproblems"
- name: Parse metadata
run: |
python openproblems/workflow/parse_metadata.py website/results
cp openproblems/main.bib website/bibliography/library.bib
cd website
git diff --exit-code --quiet || echo "CHANGED=true" >> $GITHUB_ENV
- name: Upload json
uses: actions/upload-artifact@main
with:
name: json
path: website/content/benchmarks
- name: Push to openproblems-bio/website
if: |
env.CHANGED == 'true' &&
(
startsWith(github.ref, 'refs/heads/main') ||
endsWith(github.event.head_commit.message, '# publish')
)
shell: bash
working-directory: './website'
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_WEBSITE_PAT }}
run: |
git push origin "${UPDATE_BRANCH_NAME}"
- name: Create website Pull Request
if: |
env.CHANGED == 'true' &&
(
startsWith(github.ref, 'refs/heads/main') ||
endsWith(github.event.head_commit.message, '# publish')
)
uses: peter-evans/create-pull-request@v4
with:
base: main
branch: ${{ env.UPDATE_BRANCH_NAME }}
delete-branch: true
title: '[auto] Update benchmark content'
reviewers: scottgigante-immunai,rcannood
path: './website'
token: ${{ secrets.GH_ACTIONS_WEBSITE_PAT }}
author: "openproblems-bio <[email protected]>"
commit-message: "Update benchmark content # ci skip"