Skip to content

Commit 646c0f7

Browse files
authored
Merge pull request #24 from CESNET/cron-ci
add a CI cron to create update PRs for prod instances
2 parents 5a2d31e + fa06093 commit 646c0f7

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/cron_update.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Dispatch Update
2+
3+
on:
4+
schedule:
5+
# 7:07 wednesdays
6+
- cron: '7 7 * * 3'
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
instance: [usegalaxy.cz, galaxy-umsa.grid.cesnet.cz]
18+
python-version: [3.11]
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
- name: Lint, Fix, and Update
32+
run: |
33+
make INSTANCE=$INSTANCE lint
34+
make INSTANCE=$INSTANCE update-all
35+
env:
36+
INSTANCE: ${{ matrix.instance }}
37+
- name: Set output variables
38+
id: vars
39+
run: |
40+
pr_title="Update all tools of $INSTANCE"
41+
{
42+
echo "pr_title=$pr_title"
43+
echo "branch_name=$INSTANCE"
44+
echo "pr_body<<EOF"
45+
echo "I ran the following:"
46+
echo "- make INSTANCE=$INSTANCE lint"
47+
echo "- make INSTANCE=$INSTANCE update-all"
48+
echo "EOF"
49+
} >> "$GITHUB_OUTPUT"
50+
env:
51+
INSTANCE: ${{ matrix.instance }}
52+
- name: Create Pull Request
53+
uses: peter-evans/create-pull-request@v7
54+
with:
55+
branch: create-pull-request/${{ steps.vars.outputs.branch_name }}
56+
# branch-suffix: random
57+
committer: CESNETbot <[email protected]>
58+
commit-message: ${{ steps.vars.outputs.pr_title }}
59+
title: ${{ steps.vars.outputs.pr_title }}
60+
body: ${{ steps.vars.outputs.pr_body }}
61+
labels: automated
62+
assignees: martenson
63+
reviewers: martenson
64+
# - name: Push changes
65+
# uses: ad-m/github-push-action@master
66+
# with:
67+
# github_token: ${{ secrets.GITHUB_TOKEN }}
68+
# branch: ${{ github.ref }}

0 commit comments

Comments
 (0)