From a27353efb0e4844221a59ddd916104f91c605cc3 Mon Sep 17 00:00:00 2001 From: Sander Devisscher Date: Fri, 23 Aug 2024 12:45:50 +0200 Subject: [PATCH 1/7] Update Build pkgdown site.yaml #72 --- .github/workflows/Build pkgdown site.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Build pkgdown site.yaml b/.github/workflows/Build pkgdown site.yaml index 30ff088..55f99dc 100644 --- a/.github/workflows/Build pkgdown site.yaml +++ b/.github/workflows/Build pkgdown site.yaml @@ -1,9 +1,10 @@ name: Build pkgdown site on: - pull_request: - branches: - - main + workflow_run: + workflows: ["Increment version"] + types: + - completed workflow_dispatch: concurrency: From d49d47844920ce925929e604079fb32affade214 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 23 Aug 2024 10:51:39 +0000 Subject: [PATCH 2/7] Increment version [skip ci] --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 962eaab..fac7d98 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: fistools Title: Tools & data used for wildlife management & invasive species in Flanders -Version: 1.2.2 +Version: 1.2.3 Authors@R: c( person(given = "Sander", middle = "", family = "Devisscher", "sander.devisscher@inbo.be", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2015-5731")), From e9205d4428a6fe4669518c470723dc98b2267c4b Mon Sep 17 00:00:00 2001 From: Sander Devisscher Date: Fri, 23 Aug 2024 13:22:46 +0200 Subject: [PATCH 3/7] use correct workflow name #72 --- .github/workflows/Build pkgdown site.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Build pkgdown site.yaml b/.github/workflows/Build pkgdown site.yaml index 55f99dc..d15c00a 100644 --- a/.github/workflows/Build pkgdown site.yaml +++ b/.github/workflows/Build pkgdown site.yaml @@ -1,11 +1,11 @@ name: Build pkgdown site on: - workflow_run: - workflows: ["Increment version"] + workflow_run: # Trigger the workflow based on the run of another workflow + workflows: ["increment_version"] # yaml filename of dependent workflows (without .yaml) types: - - completed - workflow_dispatch: + - completed # Trigger on completion + workflow_dispatch: # Trigger manually concurrency: group: ${{ github.ref }}-${{ github.workflow }} # Use the branch reference as the concurrency group From a142bc30d2d4382fa8b67e77a08c198b54cbf5b1 Mon Sep 17 00:00:00 2001 From: Sander Devisscher Date: Fri, 23 Aug 2024 13:40:02 +0200 Subject: [PATCH 4/7] Update Build pkgdown site.yaml #72 --- .github/workflows/Build pkgdown site.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/Build pkgdown site.yaml b/.github/workflows/Build pkgdown site.yaml index d15c00a..c2fcfe6 100644 --- a/.github/workflows/Build pkgdown site.yaml +++ b/.github/workflows/Build pkgdown site.yaml @@ -5,6 +5,9 @@ on: workflows: ["increment_version"] # yaml filename of dependent workflows (without .yaml) types: - completed # Trigger on completion + pull_request: + branches: + - main # Trigger needs to listen to pull requests to main to trigger. workflow_dispatch: # Trigger manually concurrency: From 34bdb4a7fddd91d19f4c2fd8ede5d1f31c597351 Mon Sep 17 00:00:00 2001 From: Sander Devisscher Date: Fri, 23 Aug 2024 13:58:16 +0200 Subject: [PATCH 5/7] Update Build pkgdown site.yaml #73 --- .github/workflows/Build pkgdown site.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Build pkgdown site.yaml b/.github/workflows/Build pkgdown site.yaml index c2fcfe6..5d4943a 100644 --- a/.github/workflows/Build pkgdown site.yaml +++ b/.github/workflows/Build pkgdown site.yaml @@ -5,7 +5,6 @@ on: workflows: ["increment_version"] # yaml filename of dependent workflows (without .yaml) types: - completed # Trigger on completion - pull_request: branches: - main # Trigger needs to listen to pull requests to main to trigger. workflow_dispatch: # Trigger manually From a999a0e6420f41bbc3bc39be20e66bcdef0f4308 Mon Sep 17 00:00:00 2001 From: Sander Devisscher Date: Fri, 23 Aug 2024 14:14:02 +0200 Subject: [PATCH 6/7] try again #73 --- .github/workflows/Build pkgdown site.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/Build pkgdown site.yaml b/.github/workflows/Build pkgdown site.yaml index 5d4943a..ad15b86 100644 --- a/.github/workflows/Build pkgdown site.yaml +++ b/.github/workflows/Build pkgdown site.yaml @@ -5,8 +5,6 @@ on: workflows: ["increment_version"] # yaml filename of dependent workflows (without .yaml) types: - completed # Trigger on completion - branches: - - main # Trigger needs to listen to pull requests to main to trigger. workflow_dispatch: # Trigger manually concurrency: @@ -15,6 +13,7 @@ concurrency: jobs: build-site: + needs: increment-version # Ensure this job waits for the previous job to complete runs-on: ${{ matrix.config.os }} name: ${{ matrix.config.os }} (${{ matrix.config.r }}) From 912b752bbd70f6310ef51e7f5e87aa9ddf370a87 Mon Sep 17 00:00:00 2001 From: Sander Devisscher Date: Fri, 23 Aug 2024 14:35:04 +0200 Subject: [PATCH 7/7] try 2 step approach #73 --- .github/workflows/Build pkgdown site.yaml | 5 ---- .../workflows/trigger_build_pkgdown_site.yaml | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/trigger_build_pkgdown_site.yaml diff --git a/.github/workflows/Build pkgdown site.yaml b/.github/workflows/Build pkgdown site.yaml index ad15b86..b18dd99 100644 --- a/.github/workflows/Build pkgdown site.yaml +++ b/.github/workflows/Build pkgdown site.yaml @@ -1,10 +1,6 @@ name: Build pkgdown site on: - workflow_run: # Trigger the workflow based on the run of another workflow - workflows: ["increment_version"] # yaml filename of dependent workflows (without .yaml) - types: - - completed # Trigger on completion workflow_dispatch: # Trigger manually concurrency: @@ -13,7 +9,6 @@ concurrency: jobs: build-site: - needs: increment-version # Ensure this job waits for the previous job to complete runs-on: ${{ matrix.config.os }} name: ${{ matrix.config.os }} (${{ matrix.config.r }}) diff --git a/.github/workflows/trigger_build_pkgdown_site.yaml b/.github/workflows/trigger_build_pkgdown_site.yaml new file mode 100644 index 0000000..6ee50b7 --- /dev/null +++ b/.github/workflows/trigger_build_pkgdown_site.yaml @@ -0,0 +1,28 @@ +name: Trigger Build pkgdown Site + +on: + workflow_run: + workflows: ["Increment version"] # Ensure this matches the name in increment_version.yaml + types: + - completed + +jobs: + trigger-build: + runs-on: ubuntu-latest + steps: + - name: Trigger Build pkgdown site + uses: actions/github-script@v6 + with: + script: | + const { exec } = require('child_process'); + exec('gh workflow run "Build pkgdown site"', (error, stdout, stderr) => { + if (error) { + console.error(`Error: ${error.message}`); + return; + } + if (stderr) { + console.error(`Stderr: ${stderr}`); + return; + } + console.log(`Stdout: ${stdout}`); + });