forked from openproblems-bio/openproblems
-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (82 loc) · 2.6 KB
/
update_website_content.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Update website content
on:
push:
branches:
- 'main'
- 'test_website'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
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: 1
path: openproblems
- name: Checkout website repo
uses: actions/checkout@v3
with:
fetch-depth: 1
repository: openproblems-bio/website
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 results
run: |
rm -r website/content/benchmarks/*/
python openproblems/workflow/generate_website_markdown.py website/content/benchmarks
cd website
git diff --exit-code --quiet || echo "CHANGED=true" >> $GITHUB_ENV
- name: Upload markdown
uses: actions/upload-artifact@main
with:
name: markdown
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:
branch: ${{ env.UPDATE_BRANCH_NAME }}
delete-branch: true
base: main
title: '[auto] Update benchmark content'
reviewers: scottgigante-immunai,rcannood,dburkhardt
path: './website'
token: ${{ secrets.GH_ACTIONS_WEBSITE_PAT }}
author: "openproblems-bio <[email protected]>"
commit-message: "Update benchmark content # ci skip"