From 744f144788c9dfeecd172d0ddbc60fc4b34a4790 Mon Sep 17 00:00:00 2001 From: bebatut Date: Mon, 30 Sep 2024 18:14:41 +0200 Subject: [PATCH] Merge all CRON workflow into 1 with several jobs --- .github/workflows/update-artifacts.yml | 52 ----------- .github/workflows/update-bibliography.yml | 44 --------- .github/workflows/update-schedule.yml | 52 ----------- .github/workflows/update.yml | 103 ++++++++++++++++++++++ 4 files changed, 103 insertions(+), 148 deletions(-) delete mode 100644 .github/workflows/update-artifacts.yml delete mode 100644 .github/workflows/update-bibliography.yml delete mode 100644 .github/workflows/update-schedule.yml create mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/update-artifacts.yml b/.github/workflows/update-artifacts.yml deleted file mode 100644 index d691f32f7..000000000 --- a/.github/workflows/update-artifacts.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Update artifacts - -on: - schedule: - # We'll run this weekly - - cron: '0 12 * * 1' - workflow_dispatch: - -jobs: - update-artificats: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2.2.0 - with: - # channels: conda-forge,defaults - # channel-priority: true - activate-environment: ols-website - environment-file: environment.yml - - - shell: bash -el {0} - run: | - conda info - conda list - conda config --show-sources - conda config --show - - - name: Update people data artifacts - shell: bash -el {0} - run: | - python bin/prepare_website_data.py extractfullpeopledata - - - name: Update Open Seeds library artifacts - shell: bash -el {0} - run: | - python bin/prepare_website_data.py extractlibrary -p "openseeds" - - - name: Update Open Seeds projects - shell: bash -el {0} - run: | - python bin/prepare_website_data.py createprojecttable -p "openseeds" - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 - with: - commit-message: Update artifacts - title: Automatic artifact update - body: Automatic artifact update done via GitHub Action once a week - base: main - branch: artifact-update - delete-branch: true diff --git a/.github/workflows/update-bibliography.yml b/.github/workflows/update-bibliography.yml deleted file mode 100644 index 7e0a6dad9..000000000 --- a/.github/workflows/update-bibliography.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Update bibliography - -on: - schedule: - # We'll run this weekly - - cron: '0 12 * * 1' - workflow_dispatch: - -jobs: - update-schedule: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2.2.0 - with: - # channels: conda-forge,defaults - # channel-priority: true - activate-environment: ols-website - environment-file: environment.yml - - - shell: bash -el {0} - run: | - conda info - conda list - conda config --show-sources - conda config --show - - - name: Update bibliography - shell: bash -el {0} - env: - ZOTERO_API: ${{ secrets.ZoteroAPI }} - run: | - python bin/prepare_website_data.py updatebibliography -a "$ZOTERO_API" - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 - with: - commit-message: Update bibliography - title: Automatic bibliography update - body: Automatic bibliography update done via GitHub Action once a week - base: main - branch: bibliography-update - delete-branch: true \ No newline at end of file diff --git a/.github/workflows/update-schedule.yml b/.github/workflows/update-schedule.yml deleted file mode 100644 index 7afa2567f..000000000 --- a/.github/workflows/update-schedule.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Update schedule - -on: - schedule: - # We'll run this weekly - - cron: '0 12 * * 1' - workflow_dispatch: - -jobs: - update-schedule: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2.2.0 - with: - # channels: conda-forge,defaults - # channel-priority: true - activate-environment: ols-website - environment-file: environment.yml - - - shell: bash -el {0} - run: | - conda info - conda list - conda config --show-sources - conda config --show - - - name: Update Open Seeds schedule - shell: bash -el {0} - run: | - bash bin/openseeds/update_schedule.sh - - - name: Update Open Seeds library - shell: bash -el {0} - run: | - python bin/prepare_website_data.py buildlibrary -p "openseeds" - - - name: Update Nebula schedule - shell: bash -el {0} - run: | - bash bin/nebula/update_schedule.sh - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 - with: - commit-message: Update schedule - title: Automatic schedule update - body: Automatic schedule update done via GitHub Action once a week - base: main - branch: schedule-update - delete-branch: true \ No newline at end of file diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 000000000..8cf86c624 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,103 @@ +name: Update schedule, artifacts, and bibliography + +on: + schedule: + # We'll run this weekly + - cron: '0 12 * * 1' + workflow_dispatch: + +jobs: + update-schedule-artifacts: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2.2.0 + with: + # channels: conda-forge,defaults + # channel-priority: true + activate-environment: ols-website + environment-file: environment.yml + + - shell: bash -el {0} + run: | + conda info + conda list + conda config --show-sources + conda config --show + + - name: Update Open Seeds schedule + shell: bash -el {0} + run: | + bash bin/openseeds/update_schedule.sh + + - name: Update Open Seeds library + shell: bash -el {0} + run: | + python bin/prepare_website_data.py buildlibrary -p "openseeds" + + - name: Update Nebula schedule + shell: bash -el {0} + run: | + bash bin/nebula/update_schedule.sh + + - name: Update people data artifacts + shell: bash -el {0} + run: | + python bin/prepare_website_data.py extractfullpeopledata + + - name: Update Open Seeds library artifacts + shell: bash -el {0} + run: | + python bin/prepare_website_data.py extractlibrary -p "openseeds" + + - name: Update Open Seeds projects + shell: bash -el {0} + run: | + python bin/prepare_website_data.py createprojecttable -p "openseeds" + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + commit-message: Update schedule and artifacts + title: Automatic schedule & artifact update + body: Automatic schedule update and artifacts done via GitHub Action once a week + base: main + branch: schedule-update + delete-branch: true + + update-bibliography: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2.2.0 + with: + # channels: conda-forge,defaults + # channel-priority: true + activate-environment: ols-website + environment-file: environment.yml + + - shell: bash -el {0} + run: | + conda info + conda list + conda config --show-sources + conda config --show + + - name: Update bibliography + shell: bash -el {0} + env: + ZOTERO_API: ${{ secrets.ZoteroAPI }} + run: | + python bin/prepare_website_data.py updatebibliography -a "$ZOTERO_API" + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + commit-message: Update bibliography + title: Automatic bibliography update + body: Automatic bibliography update done via GitHub Action once a week + base: main + branch: bibliography-update + delete-branch: true \ No newline at end of file