-
Notifications
You must be signed in to change notification settings - Fork 49
67 lines (59 loc) · 2.67 KB
/
update_available_software.yml
File metadata and controls
67 lines (59 loc) · 2.67 KB
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
name: Update overview of available software in EESSI
on:
workflow_dispatch:
schedule:
# run twice a day (noon + midnight)
- cron: '0 */12 * * *'
jobs:
update_available_software:
if: github.repository_owner == 'EESSI' # Prevent running on forks
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.10'
architecture: x64
- name: update overview of available software
id: update_available_software
run: |
# install required Python packages in virtual environment
python -m venv venv
. venv/bin/activate
pip install -r scripts/available_software/requirements.txt
# download https://eessi.io/api_data/data/eessi_api_metadata_software.json
# to where it's expected by docs/available_software/macros.py and scripts/available_software/available_software.py
data_dir="docs/available_software/data"
mkdir -p ${data_dir}
cd ${data_dir}
curl -OL https://eessi.io/api_data/data/eessi_api_metadata_software.json
cd -
python scripts/available_software/available_software.py
./scripts/update_generated_time.sh mkdocs.yml
git status
# determine whether pull request should be opened:
# if detailed software pages in docs/available_software/detail have been updated, then a PR should be opened
if [[ $(git status --porcelain ./docs/available_software/detail) ]]; then
echo "Software pages have been changed, PR should be opened"
echo "json_data_changed=yes" >> $GITHUB_OUTPUT
else
echo "Software pages have not been changed, no need to open PR"
echo "json_data_changed=no" >> $GITHUB_OUTPUT
fi
# remove the JSON file in the data directory, or it'll end up in the PR being opened
rm -r ${data_dir}/*.json
- name: create pull request
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
if: steps.update_available_software.outputs.json_data_changed == 'yes'
with:
add-paths: |
docs/available_software
mkdocs.yml
branch: update-software-overview
branch-suffix: timestamp
commit-message: update overview of available software
title: update overview of available software
body: ''
token: ${{ secrets.EESSIBOT_GITHUB_TOKEN }}
push-to-fork: EESSIbot/docs