From fc422594f83df962e72c2fda1cbdbcafe8fcf010 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 15:19:30 -0800 Subject: [PATCH 01/38] fixed README usage info --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f23ef5..db20441 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ using the following command in a terminal: quarto preview --render all --no-watch-inputs --no-browse ``` -For new features or fixes, create an issue on github in a new branch. +For new features or fixes, create an issue on github and create a new branch with the changes. Then open a pull request using `gh` commandline utility to merge changes into the `dev` branch, like the example below for issue #4. From 5a37c98495b0a9d3e832313ad6059698726c6370 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Wed, 29 Jan 2025 13:27:50 -0800 Subject: [PATCH 02/38] pull request test for dev into main --- .github/workflows/quarto.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index e495c42..8f2bafa 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -4,7 +4,7 @@ name: quarto website on: # Triggers the workflow on push or pull request events but only for the specified branches push: - branches: [ "main", "dev" ] + branches: [ "main", "dev", "pr_actions_test", "dev_pr_test"] # pull_request: # branches: [ "main", "dev" ] @@ -81,13 +81,14 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 + - name: create pull request id: cpr uses: peter-evans/create-pull-request@v7 with: commit-message: "merge dev into main" - branch: dev - base: pr_actions_test + base: pr_actions_test + branch: dev_pr_test assignees: jennylsmith reviewers: jennylsmith From 0d21a1537c99022ad30928a9aa90ef12a02d7217 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Wed, 29 Jan 2025 13:50:59 -0800 Subject: [PATCH 03/38] modify checkout step for PR; make PR draft-only --- .github/workflows/quarto.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 8f2bafa..e176ee1 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -33,7 +33,7 @@ concurrency: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: - contents: read + contents: write pages: write id-token: write pull-requests: write @@ -74,6 +74,7 @@ jobs: path: ./docs # pull request + # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs pull_request: if: ${{ vars.RUN_PR_STEP == true }} needs: build @@ -81,6 +82,9 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 + with: + oken: ${{ secrets.PAT }} + repository: jennylsmith/jennylsmith.github.io - name: create pull request id: cpr @@ -89,6 +93,7 @@ jobs: commit-message: "merge dev into main" base: pr_actions_test branch: dev_pr_test + draft: always-true assignees: jennylsmith reviewers: jennylsmith From 29c34eef9e50d3ddb6bb3ea8d90bde28bccf9ade Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Wed, 29 Jan 2025 13:56:32 -0800 Subject: [PATCH 04/38] added ready_for_review trigger --- .github/workflows/quarto.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index e176ee1..93517c5 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -5,6 +5,8 @@ on: # Triggers the workflow on push or pull request events but only for the specified branches push: branches: [ "main", "dev", "pr_actions_test", "dev_pr_test"] + ready_for_review: + ["main", "dev", "pr_actions_test", "dev_pr_test"] # pull_request: # branches: [ "main", "dev" ] @@ -83,7 +85,7 @@ jobs: - name: checkout uses: actions/checkout@v4 with: - oken: ${{ secrets.PAT }} + token: ${{ secrets.PAT }} repository: jennylsmith/jennylsmith.github.io - name: create pull request From 190cdc7896bd8e0bbd9d20f36717d7ae8ec410fc Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 15:57:57 -0800 Subject: [PATCH 05/38] updated the base branch and added an example variable step in the deploy job --- .github/workflows/quarto.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 93517c5..db822ef 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -4,9 +4,9 @@ name: quarto website on: # Triggers the workflow on push or pull request events but only for the specified branches push: - branches: [ "main", "dev", "pr_actions_test", "dev_pr_test"] - ready_for_review: - ["main", "dev", "pr_actions_test", "dev_pr_test"] + branches: [ "main", "dev", "main_pr_test", "dev_pr_test"] + # ready_for_review: + # ["main", "dev", "pr_actions_test", "dev_pr_test"] # pull_request: # branches: [ "main", "dev" ] @@ -93,7 +93,7 @@ jobs: uses: peter-evans/create-pull-request@v7 with: commit-message: "merge dev into main" - base: pr_actions_test + base: main_pr_test branch: dev_pr_test draft: always-true assignees: jennylsmith @@ -103,16 +103,20 @@ jobs: deploy: # Add a dependency to the job needs: build - # add and if statement later? ${{ github.event.repository.default_branch }} + # define env vars + # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables + env: + BRANCH: ${{ github.HEAD_REF }} # Deploy to the github-pages environment environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - # Specify runner runs-on: ubuntu-latest # deploy to gh pages steps: - - name: deploy to GitHub pages - id: deployment - uses: actions/deploy-pages@v4 + - name: "vars example" + run: echo "the gh branch that triggered the workflow is $BRANCH" + # - name: deploy to GitHub pages + # id: deployment + # uses: actions/deploy-pages@v4 From 5c818e00501de6718996be335b481ffaf19c0c82 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 16:44:52 -0800 Subject: [PATCH 06/38] change workflow name and set to dispatch trigger --- .github/workflows/quarto.yml | 56 ++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index db822ef..01d93eb 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -1,15 +1,17 @@ -name: quarto website +name: quarto-website # Controls when the workflow will run on: + workflow_dispatch # Triggers the workflow on push or pull request events but only for the specified branches - push: - branches: [ "main", "dev", "main_pr_test", "dev_pr_test"] + # push: + # branches: [ "main", "dev", "main_pr_test", "dev_pr_test"] # ready_for_review: # ["main", "dev", "pr_actions_test", "dev_pr_test"] # pull_request: # branches: [ "main", "dev" ] + # # Allows you to run this workflow manually from the Actions tab # workflow_dispatch: @@ -99,24 +101,30 @@ jobs: assignees: jennylsmith reviewers: jennylsmith - # deploy job - deploy: - # Add a dependency to the job - needs: build - # define env vars - # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables - env: - BRANCH: ${{ github.HEAD_REF }} - # Deploy to the github-pages environment - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - # Specify runner - runs-on: ubuntu-latest - # deploy to gh pages - steps: - - name: "vars example" - run: echo "the gh branch that triggered the workflow is $BRANCH" - # - name: deploy to GitHub pages - # id: deployment - # uses: actions/deploy-pages@v4 + # # deploy job + # deploy: + # # Add a dependency to the job + # needs: build + # # define env vars + # # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables + # env: + # BRANCH: ${{ github.HEAD_REF }} + # ACTIONS_RUNNER_DEBUG: true + # # Deploy to the github-pages environment + # # Settings and variables here: https://github.com/jennylsmith/jennylsmith.github.io/settings/environments + # # environment: + # # name: github-pages + # # url: ${{ steps.deployment.outputs.page_url }} + # environment: + # name: dev + # # Specify runner + # runs-on: ubuntu-latest + # # deploy to gh pages + # steps: + # - name: "vars example" + # run: | + # echo "the gh branch that triggered the workflow is $BRANCH" + # echo "debug set to $ACTIONS_RUNNER_DEBUG" + # # - name: deploy to GitHub pages + # # id: deployment + # # uses: actions/deploy-pages@v4 From f210eb33616d33faf17f53c7288849c85bbce8d7 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 16:50:07 -0800 Subject: [PATCH 07/38] include on push test branch --- .github/workflows/quarto.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 01d93eb..4321833 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -2,18 +2,16 @@ name: quarto-website # Controls when the workflow will run on: - workflow_dispatch # Triggers the workflow on push or pull request events but only for the specified branches - # push: - # branches: [ "main", "dev", "main_pr_test", "dev_pr_test"] + push: + branches: [ "main", "dev", "main_pr_test", "dev_pr_test"] # ready_for_review: # ["main", "dev", "pr_actions_test", "dev_pr_test"] # pull_request: # branches: [ "main", "dev" ] - - # # Allows you to run this workflow manually from the Actions tab - # workflow_dispatch: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: # Debugging log info # https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging From 4d4e2103bd55452adac77ecf5bdaa0ab4eda5529 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 16:57:50 -0800 Subject: [PATCH 08/38] set deploy env to dev --- .github/workflows/quarto.yml | 56 ++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 4321833..d8157a9 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -10,7 +10,7 @@ on: # pull_request: # branches: [ "main", "dev" ] - # Allows you to run this workflow manually from the Actions tab + # Allows you to run this workflow manually from the Actions tab or gh CLI workflow_dispatch: # Debugging log info @@ -99,30 +99,30 @@ jobs: assignees: jennylsmith reviewers: jennylsmith - # # deploy job - # deploy: - # # Add a dependency to the job - # needs: build - # # define env vars - # # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables - # env: - # BRANCH: ${{ github.HEAD_REF }} - # ACTIONS_RUNNER_DEBUG: true - # # Deploy to the github-pages environment - # # Settings and variables here: https://github.com/jennylsmith/jennylsmith.github.io/settings/environments - # # environment: - # # name: github-pages - # # url: ${{ steps.deployment.outputs.page_url }} - # environment: - # name: dev - # # Specify runner - # runs-on: ubuntu-latest - # # deploy to gh pages - # steps: - # - name: "vars example" - # run: | - # echo "the gh branch that triggered the workflow is $BRANCH" - # echo "debug set to $ACTIONS_RUNNER_DEBUG" - # # - name: deploy to GitHub pages - # # id: deployment - # # uses: actions/deploy-pages@v4 + # deploy job + deploy: + # Add a dependency to the job + needs: build + # define env vars + # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables + env: + BRANCH: ${{ github.HEAD_REF }} + ACTIONS_RUNNER_DEBUG: true + # Deploy to the github-pages environment + # Settings and variables here: https://github.com/jennylsmith/jennylsmith.github.io/settings/environments + # environment: + # name: github-pages + # url: ${{ steps.deployment.outputs.page_url }} + environment: + name: dev + # Specify runner + runs-on: ubuntu-latest + # deploy to gh pages + steps: + - name: "vars example" + run: | + echo "the gh branch that triggered the workflow is $BRANCH" + echo "debug set to $ACTIONS_RUNNER_DEBUG" + # - name: deploy to GitHub pages + # id: deployment + # uses: actions/deploy-pages@v4 From 782fcd044712ccea7994c9f6c7768bf446d83481 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 17:03:32 -0800 Subject: [PATCH 09/38] remove BRANCH variable since default github vars not accessible in env context --- .github/workflows/quarto.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index d8157a9..2b8ca2f 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -105,8 +105,8 @@ jobs: needs: build # define env vars # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables + # default env vars are not accessible through the env context env: - BRANCH: ${{ github.HEAD_REF }} ACTIONS_RUNNER_DEBUG: true # Deploy to the github-pages environment # Settings and variables here: https://github.com/jennylsmith/jennylsmith.github.io/settings/environments @@ -121,7 +121,7 @@ jobs: steps: - name: "vars example" run: | - echo "the gh branch that triggered the workflow is $BRANCH" + echo "the gh branch that triggered the workflow is $GITHUB_REF_NAME" echo "debug set to $ACTIONS_RUNNER_DEBUG" # - name: deploy to GitHub pages # id: deployment From 58554f4fd5d7e7428d8bf4284510116c7b4f1357 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 17:08:29 -0800 Subject: [PATCH 10/38] added if statement to determine whether the deploy job should be run --- .github/workflows/quarto.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 2b8ca2f..009b495 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -101,6 +101,7 @@ jobs: # deploy job deploy: + if: ${{ github.ref_name == "dev_pr_test" }} # Add a dependency to the job needs: build # define env vars From d605c6126f070cdb0630f7129a9554d39b4ade85 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 17:12:09 -0800 Subject: [PATCH 11/38] use single quotes in conditional statement --- .github/workflows/quarto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 009b495..4b7de25 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -101,7 +101,7 @@ jobs: # deploy job deploy: - if: ${{ github.ref_name == "dev_pr_test" }} + if: ${{ github.ref_name == 'dev_pr_test' }} # Add a dependency to the job needs: build # define env vars From 662f611ddd7f05caa9c26c1416dd578fc3f37b2f Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 17:18:00 -0800 Subject: [PATCH 12/38] deploy if branch is main --- .github/workflows/quarto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 4b7de25..2e68e0f 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -101,7 +101,7 @@ jobs: # deploy job deploy: - if: ${{ github.ref_name == 'dev_pr_test' }} + if: ${{ github.ref_name == 'main' }} # Add a dependency to the job needs: build # define env vars From 3ad63d4ea98e142cb9d23fd4554d110232becbb7 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 17:26:37 -0800 Subject: [PATCH 13/38] determine how to set RUN_PR_STEP value in the vars context --- .github/workflows/quarto.yml | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 2e68e0f..6453e4a 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -81,23 +81,32 @@ jobs: if: ${{ vars.RUN_PR_STEP == true }} needs: build runs-on: ubuntu-latest + environment: + name: dev + env: + CREATE_PR: ${{ vars.RUN_PR_STEP }} steps: - name: checkout uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} repository: jennylsmith/jennylsmith.github.io + + - name: "vars example" + run: | + echo the vars context value is ${{ vars.RUN_PR_STEP }} + echo the env context value is $CREATE_PR - - name: create pull request - id: cpr - uses: peter-evans/create-pull-request@v7 - with: - commit-message: "merge dev into main" - base: main_pr_test - branch: dev_pr_test - draft: always-true - assignees: jennylsmith - reviewers: jennylsmith + # - name: create pull request + # id: cpr + # uses: peter-evans/create-pull-request@v7 + # with: + # commit-message: "merge dev into main" + # base: main_pr_test + # branch: dev_pr_test + # draft: always-true + # assignees: jennylsmith + # reviewers: jennylsmith # deploy job deploy: From 6120b98f07beb5f0c850841eb3d806a4e89cb402 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 17:27:44 -0800 Subject: [PATCH 14/38] change conditional to check if strings match --- .github/workflows/quarto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 6453e4a..bb32595 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -78,7 +78,7 @@ jobs: # pull request # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs pull_request: - if: ${{ vars.RUN_PR_STEP == true }} + if: ${{ vars.RUN_PR_STEP == 'true' }} needs: build runs-on: ubuntu-latest environment: From c00ec282a59dcbcb10d10b051f6d5f11f0827001 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 17:28:43 -0800 Subject: [PATCH 15/38] fix type-o in yml format --- .github/workflows/quarto.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index bb32595..077d4a5 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -78,7 +78,7 @@ jobs: # pull request # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs pull_request: - if: ${{ vars.RUN_PR_STEP == 'true' }} + if: ${{ vars.RUN_PR_STEP == true }} needs: build runs-on: ubuntu-latest environment: @@ -93,7 +93,7 @@ jobs: repository: jennylsmith/jennylsmith.github.io - name: "vars example" - run: | + run: | echo the vars context value is ${{ vars.RUN_PR_STEP }} echo the env context value is $CREATE_PR From 87fee024e5561683d07825f47e39b58a85183364 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 17:30:17 -0800 Subject: [PATCH 16/38] change conditional value to test to a string for PR job --- .github/workflows/quarto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 077d4a5..86d5b4d 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -78,7 +78,7 @@ jobs: # pull request # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs pull_request: - if: ${{ vars.RUN_PR_STEP == true }} + if: ${{ vars.RUN_PR_STEP == 'true' }} needs: build runs-on: ubuntu-latest environment: From ebafb56af1a7a6d14a7e49d2c5c3d82472821cd0 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 17:33:04 -0800 Subject: [PATCH 17/38] remove if statement --- .github/workflows/quarto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 86d5b4d..0e2c609 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -77,8 +77,8 @@ jobs: # pull request # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs + # if: ${{ vars.RUN_PR_STEP == 'true' }} pull_request: - if: ${{ vars.RUN_PR_STEP == 'true' }} needs: build runs-on: ubuntu-latest environment: From 56d8bc5c846b84f11646e6ca3ead6cb89c028f45 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 17:36:28 -0800 Subject: [PATCH 18/38] move env block to the specific step --- .github/workflows/quarto.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 0e2c609..192c6e2 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -83,8 +83,6 @@ jobs: runs-on: ubuntu-latest environment: name: dev - env: - CREATE_PR: ${{ vars.RUN_PR_STEP }} steps: - name: checkout uses: actions/checkout@v4 @@ -92,10 +90,12 @@ jobs: token: ${{ secrets.PAT }} repository: jennylsmith/jennylsmith.github.io - - name: "vars example" + - name: vars_example run: | echo the vars context value is ${{ vars.RUN_PR_STEP }} echo the env context value is $CREATE_PR + env: + CREATE_PR: ${{ vars.RUN_PR_STEP }} # - name: create pull request # id: cpr From 758dc37a69a782510fa36b7a6751c3758d543b3a Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 17:45:13 -0800 Subject: [PATCH 19/38] use default credentials for checkout in PR --- .github/workflows/quarto.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 192c6e2..f20c050 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -86,10 +86,7 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 - with: - token: ${{ secrets.PAT }} - repository: jennylsmith/jennylsmith.github.io - + - name: vars_example run: | echo the vars context value is ${{ vars.RUN_PR_STEP }} From b7b274ac3d4cd12a9ee51d2dccdf528676ebd3d3 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 17:47:58 -0800 Subject: [PATCH 20/38] if statement to determine if PR job should be run --- .github/workflows/quarto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index f20c050..b6a5865 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -77,8 +77,8 @@ jobs: # pull request # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs - # if: ${{ vars.RUN_PR_STEP == 'true' }} pull_request: + if: ${{ vars.RUN_PR_STEP == 'true' }} needs: build runs-on: ubuntu-latest environment: From cbf7ba68a4e8cb4011ec5fcbff06b5859e42bf54 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 18:28:37 -0800 Subject: [PATCH 21/38] added ssh key for checkout step in PR job --- .github/workflows/quarto.yml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index b6a5865..62922f2 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -78,7 +78,7 @@ jobs: # pull request # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs pull_request: - if: ${{ vars.RUN_PR_STEP == 'true' }} + if: ${{ github.ref_name == 'dev_pr_test' }} needs: build runs-on: ubuntu-latest environment: @@ -86,24 +86,18 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_WEBSITE_KEY }} + - name: create-pull-request + id: cpr + uses: peter-evans/create-pull-request@v7 + with: + commit-message: merge dev into main + title: PR from ${{ github.run_id }} + base: main_pr_test + branch: dev_pr_test + draft: always-true - - name: vars_example - run: | - echo the vars context value is ${{ vars.RUN_PR_STEP }} - echo the env context value is $CREATE_PR - env: - CREATE_PR: ${{ vars.RUN_PR_STEP }} - - # - name: create pull request - # id: cpr - # uses: peter-evans/create-pull-request@v7 - # with: - # commit-message: "merge dev into main" - # base: main_pr_test - # branch: dev_pr_test - # draft: always-true - # assignees: jennylsmith - # reviewers: jennylsmith # deploy job deploy: From 8b98d9bb04165eabe84f68e67f3a2e931a483769 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 19:00:46 -0800 Subject: [PATCH 22/38] look at the default settings of PR --- .github/workflows/quarto.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 62922f2..2e8aa52 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -94,8 +94,6 @@ jobs: with: commit-message: merge dev into main title: PR from ${{ github.run_id }} - base: main_pr_test - branch: dev_pr_test draft: always-true From 183d6dfc395830ece14a44ab02e31fb6c695cae6 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 19:07:01 -0800 Subject: [PATCH 23/38] set branch in PR --- .github/workflows/quarto.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 2e8aa52..0dbe465 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -95,6 +95,7 @@ jobs: commit-message: merge dev into main title: PR from ${{ github.run_id }} draft: always-true + branch: main_pr_test # deploy job From 2f722a632a433bf3c429773b830ab65cfc3ae632 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 19:21:31 -0800 Subject: [PATCH 24/38] set ref in checkout step to main --- .github/workflows/quarto.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 0dbe465..d4c3839 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -88,6 +88,7 @@ jobs: uses: actions/checkout@v4 with: ssh-key: ${{ secrets.SSH_WEBSITE_KEY }} + ref: main_pr_test - name: create-pull-request id: cpr uses: peter-evans/create-pull-request@v7 @@ -95,7 +96,7 @@ jobs: commit-message: merge dev into main title: PR from ${{ github.run_id }} draft: always-true - branch: main_pr_test + branch: dev_pr_test # deploy job From b30a9639802a9629a1cfd8cc866379c31c947266 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Mon, 24 Feb 2025 19:28:27 -0800 Subject: [PATCH 25/38] checkout the main_pr_test branch and see if that sets main_pr_test as working base branch --- .github/workflows/quarto.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index d4c3839..7e6aa59 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -96,7 +96,6 @@ jobs: commit-message: merge dev into main title: PR from ${{ github.run_id }} draft: always-true - branch: dev_pr_test # deploy job From 98e4fe11473ca3eafe728b1903718eaba313e9ef Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 12:14:35 -0800 Subject: [PATCH 26/38] specify branch in create-pull-request step --- .github/workflows/quarto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 7e6aa59..f4e0401 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -96,8 +96,8 @@ jobs: commit-message: merge dev into main title: PR from ${{ github.run_id }} draft: always-true + branch: ${{ github.ref }} - # deploy job deploy: if: ${{ github.ref_name == 'main' }} From ad8bb925124ea0c50fb189340c1b314aa570d93d Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 13:13:48 -0800 Subject: [PATCH 27/38] add actions cache if artifacts are built --- .github/workflows/quarto.yml | 72 +++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index f4e0401..7918b95 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -50,53 +50,73 @@ jobs: QUARTO_VERSION: 1.5.57 # Steps represent a sequence of tasks that will be executed as part of the job steps: - # install quarto - - name: install quarto CLI - run: | - wget -O ${{ runner.temp }}/quarto.deb https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb \ - && sudo dpkg -i ${{ runner.temp }}/quarto.deb + - name: Cache Artifacts + id: cache-artifacts + uses: actions/cache@v4 + with: + path: ./docs + key: ${{ steps.artifact.outputs.artifact_id }}-key # checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: checkout uses: actions/checkout@v4 - + # setup gh pages - name: setup pages id: pages uses: actions/configure-pages@v5 + + # install quarto + - name: install quarto CLI + if: steps.cache-artifacts.outputs.cache-hit != 'true' + run: | + wget -O ${{ runner.temp }}/quarto.deb https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb \ + && sudo dpkg -i ${{ runner.temp }}/quarto.deb # render the website - name: render website + if: steps.cache-artifacts.outputs.cache-hit != 'true' run: quarto render # upload the rendered website (artifact) - name: upload artifact + if: steps.cache-artifacts.outputs.cache-hit != 'true' + id: artifact uses: actions/upload-pages-artifact@v3 with: path: ./docs + + - name: generate cache key + id: cache-key + run: echo ${{ steps.artifact.outputs.artifact_id }} > ./docs/${{ steps.artifact.outputs.artifact_id }}-key # pull request # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs - pull_request: - if: ${{ github.ref_name == 'dev_pr_test' }} - needs: build - runs-on: ubuntu-latest - environment: - name: dev - steps: - - name: checkout - uses: actions/checkout@v4 - with: - ssh-key: ${{ secrets.SSH_WEBSITE_KEY }} - ref: main_pr_test - - name: create-pull-request - id: cpr - uses: peter-evans/create-pull-request@v7 - with: - commit-message: merge dev into main - title: PR from ${{ github.run_id }} - draft: always-true - branch: ${{ github.ref }} + # pull_request: + # if: ${{ github.ref_name == 'dev_pr_test' }} + # needs: build + # runs-on: ubuntu-latest + # environment: + # name: dev + # steps: + # - name: checkout + # uses: actions/checkout@v4 + # with: + # ssh-key: ${{ secrets.SSH_WEBSITE_KEY }} + # ref: main_pr_test + # - name: gh-cli-auth + # run: gh --version + # - name: gh-cli-pr + # run: + + # - name: create-pull-request + # id: cpr + # uses: peter-evans/create-pull-request@v7 + # with: + # commit-message: merge dev into main + # title: PR from ${{ github.run_id }} + # draft: always-true + # branch: ${{ github.ref }} # deploy job deploy: From 93189ad570a39b52b06eb647a4e318c38ecb2cc6 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 14:05:03 -0800 Subject: [PATCH 28/38] use OUTPUT_DIR env var to generate a cache key --- .github/workflows/quarto.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 7918b95..84e1cd7 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -48,14 +48,9 @@ jobs: runs-on: ubuntu-latest env: QUARTO_VERSION: 1.5.57 + OUTPUT_DIR: docs # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: Cache Artifacts - id: cache-artifacts - uses: actions/cache@v4 - with: - path: ./docs - key: ${{ steps.artifact.outputs.artifact_id }}-key # checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: checkout @@ -65,7 +60,14 @@ jobs: - name: setup pages id: pages uses: actions/configure-pages@v5 - + + - name: Cache Artifacts + id: cache-artifacts + uses: actions/cache@v4 + with: + path: ${{ env.OUTPUT_DIR }} + key: ${{ hashFiles(**/*.*) }}-key + # install quarto - name: install quarto CLI if: steps.cache-artifacts.outputs.cache-hit != 'true' @@ -80,15 +82,16 @@ jobs: # upload the rendered website (artifact) - name: upload artifact - if: steps.cache-artifacts.outputs.cache-hit != 'true' id: artifact uses: actions/upload-pages-artifact@v3 with: - path: ./docs + path: ${{ env.OUTPUT_DIR }} + + # - name: generate cache key + # if: steps.cache-artifacts.outputs.cache-hit != 'true' + # id: cache-key + # run: echo ${{ steps.artifact.outputs.artifact_id }} > ./$OUTPUT_DIR/${{ steps.artifact.outputs.artifact_id }}-key - - name: generate cache key - id: cache-key - run: echo ${{ steps.artifact.outputs.artifact_id }} > ./docs/${{ steps.artifact.outputs.artifact_id }}-key # pull request # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs From d52e8b82b334500963fe4436586a0cce7e4e2a2b Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 14:06:17 -0800 Subject: [PATCH 29/38] use OUTPUT_DIR env var to generate a cache key. fix input to hashFiles function --- .github/workflows/quarto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 84e1cd7..0834942 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -66,7 +66,7 @@ jobs: uses: actions/cache@v4 with: path: ${{ env.OUTPUT_DIR }} - key: ${{ hashFiles(**/*.*) }}-key + key: ${{ hashFiles('**/*.*'') }}-key # install quarto - name: install quarto CLI From 48d816bc9940548c18f7cb22e80fff41befac765 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 14:06:56 -0800 Subject: [PATCH 30/38] use OUTPUT_DIR env var to generate a cache key. fix input to hashFiles function again --- .github/workflows/quarto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 0834942..a27fc51 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -66,7 +66,7 @@ jobs: uses: actions/cache@v4 with: path: ${{ env.OUTPUT_DIR }} - key: ${{ hashFiles('**/*.*'') }}-key + key: ${{ hashFiles('**/*.*') }}-key # install quarto - name: install quarto CLI From 276fe011daa73a84796005a8ff91fc1733ff9cb7 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 14:19:08 -0800 Subject: [PATCH 31/38] specify search dir for hashFiles function and check the output of the step --- .github/workflows/quarto.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index a27fc51..aefdf1a 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -61,12 +61,17 @@ jobs: id: pages uses: actions/configure-pages@v5 + # cache rendered website artifacts - name: Cache Artifacts id: cache-artifacts uses: actions/cache@v4 with: path: ${{ env.OUTPUT_DIR }} - key: ${{ hashFiles('**/*.*') }}-key + key: ${{ hashFiles('**/$OUTPUT_DIR') }}-key + + - name: check outputs + run: | + echo the cache hit output is: ${{ steps.cache-artifacts.outputs.cache-hit }} # install quarto - name: install quarto CLI From ddc50e4c0eaa98963c2f9e08d5c6dc59f0862ea8 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 14:31:08 -0800 Subject: [PATCH 32/38] fix variable syntax for hashFiles function --- .github/workflows/quarto.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index aefdf1a..407024f 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -47,8 +47,11 @@ jobs: # The type of runner that the job will run on runs-on: ubuntu-latest env: + ACTIONS_RUNNER_DEBUG: true QUARTO_VERSION: 1.5.57 OUTPUT_DIR: docs + CACHE_PATH: 'docs/*.*' + # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -67,7 +70,7 @@ jobs: uses: actions/cache@v4 with: path: ${{ env.OUTPUT_DIR }} - key: ${{ hashFiles('**/$OUTPUT_DIR') }}-key + key: ${{ hashFiles(env.CACHE_PATH) }}-key - name: check outputs run: | From 750abf4e5ed3f93bc38044c4cc4599ac48836be5 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 14:40:29 -0800 Subject: [PATCH 33/38] change CACHE_PATH and add double quotes to DEBUG env variable --- .github/workflows/quarto.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 407024f..1a0b4b7 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -47,11 +47,11 @@ jobs: # The type of runner that the job will run on runs-on: ubuntu-latest env: - ACTIONS_RUNNER_DEBUG: true + ACTIONS_RUNNER_DEBUG: "true" QUARTO_VERSION: 1.5.57 OUTPUT_DIR: docs - CACHE_PATH: 'docs/*.*' - + CACHE_PATH: '**/docs/*.*' + # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -70,7 +70,7 @@ jobs: uses: actions/cache@v4 with: path: ${{ env.OUTPUT_DIR }} - key: ${{ hashFiles(env.CACHE_PATH) }}-key + key: ${{ github.ref_name }}-${{ hashFiles(env.CACHE_PATH) }}-key - name: check outputs run: | From 0577c286f605ca5acc0bb04807144b3a153d0f1b Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 14:50:57 -0800 Subject: [PATCH 34/38] move cache step to end of build job --- .github/workflows/quarto.yml | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 1a0b4b7..ac270fd 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -63,18 +63,6 @@ jobs: - name: setup pages id: pages uses: actions/configure-pages@v5 - - # cache rendered website artifacts - - name: Cache Artifacts - id: cache-artifacts - uses: actions/cache@v4 - with: - path: ${{ env.OUTPUT_DIR }} - key: ${{ github.ref_name }}-${{ hashFiles(env.CACHE_PATH) }}-key - - - name: check outputs - run: | - echo the cache hit output is: ${{ steps.cache-artifacts.outputs.cache-hit }} # install quarto - name: install quarto CLI @@ -94,12 +82,14 @@ jobs: uses: actions/upload-pages-artifact@v3 with: path: ${{ env.OUTPUT_DIR }} - - # - name: generate cache key - # if: steps.cache-artifacts.outputs.cache-hit != 'true' - # id: cache-key - # run: echo ${{ steps.artifact.outputs.artifact_id }} > ./$OUTPUT_DIR/${{ steps.artifact.outputs.artifact_id }}-key - + + # cache rendered website artifacts + - name: Cache Artifacts + id: cache-artifacts + uses: actions/cache/save@v4 + with: + path: ${{ env.OUTPUT_DIR }} + key: ${{ github.ref_name }}-${{ hashFiles(env.CACHE_PATH) }}-key # pull request # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs From a1641ed29c0bdf1f619ad8f90c2a08a7cfb957d4 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 15:13:21 -0800 Subject: [PATCH 35/38] try using save and restore cache steps --- .github/workflows/quarto.yml | 38 +++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index ac270fd..1d61dec 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -47,7 +47,6 @@ jobs: # The type of runner that the job will run on runs-on: ubuntu-latest env: - ACTIONS_RUNNER_DEBUG: "true" QUARTO_VERSION: 1.5.57 OUTPUT_DIR: docs CACHE_PATH: '**/docs/*.*' @@ -63,6 +62,13 @@ jobs: - name: setup pages id: pages uses: actions/configure-pages@v5 + + - name: restore artifacts + id: cache-artifacts + uses: actions/cache/restore@v4 + with: + path: ${{ env.OUTPUT_DIR }} + key: ${{ github.ref_name }}-${{ hashFiles(env.CACHE_PATH) }}-key # install quarto - name: install quarto CLI @@ -85,7 +91,7 @@ jobs: # cache rendered website artifacts - name: Cache Artifacts - id: cache-artifacts + id: create-cache uses: actions/cache/save@v4 with: path: ${{ env.OUTPUT_DIR }} @@ -93,20 +99,20 @@ jobs: # pull request # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs - # pull_request: - # if: ${{ github.ref_name == 'dev_pr_test' }} - # needs: build - # runs-on: ubuntu-latest - # environment: - # name: dev - # steps: - # - name: checkout - # uses: actions/checkout@v4 - # with: - # ssh-key: ${{ secrets.SSH_WEBSITE_KEY }} - # ref: main_pr_test - # - name: gh-cli-auth - # run: gh --version + pull_request: + if: ${{ github.ref_name == 'dev_pr_test' }} + needs: build + runs-on: ubuntu-latest + environment: + name: dev + steps: + - name: checkout + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_WEBSITE_KEY }} + ref: main_pr_test + - name: gh-cli-auth + run: gh --version # - name: gh-cli-pr # run: From be52e9d7b03aaf2fa572fca5a1703d7913226dfa Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 15:50:54 -0800 Subject: [PATCH 36/38] added gh cli PR create --- .github/workflows/quarto.yml | 56 +++++++++++++++++------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 1d61dec..33de5c5 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -5,28 +5,9 @@ on: # Triggers the workflow on push or pull request events but only for the specified branches push: branches: [ "main", "dev", "main_pr_test", "dev_pr_test"] - # ready_for_review: - # ["main", "dev", "pr_actions_test", "dev_pr_test"] - # pull_request: - # branches: [ "main", "dev" ] - # Allows you to run this workflow manually from the Actions tab or gh CLI workflow_dispatch: -# Debugging log info -# https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging - -# temporarily use conditional statement to skip PR while troubleshooting -# env: A map of variables that are available to the steps of all jobs in the workflow. - # The env context contains variables that have been set in a workflow, job, or step. -# env: -# RUN_PR_STEP: "${{ false }}" - -# The vars context contains custom configuration variables set at the organization, repository, and environment levels. -# repository or environment variables can be set on Github or the GH Actions extension in VSCode -# https://github.com/jennylsmith/jennylsmith.github.io/settings/variables/actions -# if statements can only access thse expression contexts: github, inputs, vars, needs - # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: @@ -68,7 +49,7 @@ jobs: uses: actions/cache/restore@v4 with: path: ${{ env.OUTPUT_DIR }} - key: ${{ github.ref_name }}-${{ hashFiles(env.CACHE_PATH) }}-key + key: ${{ github.ref_name }}-${{ github.sha }}-key # install quarto - name: install quarto CLI @@ -95,7 +76,7 @@ jobs: uses: actions/cache/save@v4 with: path: ${{ env.OUTPUT_DIR }} - key: ${{ github.ref_name }}-${{ hashFiles(env.CACHE_PATH) }}-key + key: ${{ github.ref_name }}-${{ github.sha }}-key # pull request # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs @@ -105,14 +86,19 @@ jobs: runs-on: ubuntu-latest environment: name: dev + env: + BASE: main_pr_test steps: - name: checkout uses: actions/checkout@v4 with: - ssh-key: ${{ secrets.SSH_WEBSITE_KEY }} + token: ${{ secrets.GH_PAT }} ref: main_pr_test - - name: gh-cli-auth - run: gh --version + - name: gh-cli-pr + run: | + gh auth login --with-token < $( echo ${{ secrets.GH_PAT }} ) && \ + gh pr create -B $BASE -H ${{ github.ref_name }} --title "PR for ${github.sha::7} on RUN_ID ${{ github.run_id }}" --draft && \ + gh auth logout # - name: gh-cli-pr # run: @@ -130,11 +116,6 @@ jobs: if: ${{ github.ref_name == 'main' }} # Add a dependency to the job needs: build - # define env vars - # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables - # default env vars are not accessible through the env context - env: - ACTIONS_RUNNER_DEBUG: true # Deploy to the github-pages environment # Settings and variables here: https://github.com/jennylsmith/jennylsmith.github.io/settings/environments # environment: @@ -153,3 +134,20 @@ jobs: # - name: deploy to GitHub pages # id: deployment # uses: actions/deploy-pages@v4 + + +#### NOTES + +# Debugging log info +# https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging + +# temporarily use conditional statement to skip PR while troubleshooting +# env: A map of variables that are available to the steps of all jobs in the workflow. + # The env context contains variables that have been set in a workflow, job, or step. +# env: +# RUN_PR_STEP: "${{ false }}" + +# The vars context contains custom configuration variables set at the organization, repository, and environment levels. +# repository or environment variables can be set on Github or the GH Actions extension in VSCode +# https://github.com/jennylsmith/jennylsmith.github.io/settings/variables/actions +# if statements can only access thse expression contexts: github, inputs, vars, needs From 1b4ffc242d77c8a1e1afa83e2a00e7e277ba72a8 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 16:04:15 -0800 Subject: [PATCH 37/38] fix standard input for gh cli --- .github/workflows/quarto.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 33de5c5..372651c 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -55,7 +55,7 @@ jobs: - name: install quarto CLI if: steps.cache-artifacts.outputs.cache-hit != 'true' run: | - wget -O ${{ runner.temp }}/quarto.deb https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb \ + wget -O ${{ runner.temp }}/quarto.deb --quiet https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb \ && sudo dpkg -i ${{ runner.temp }}/quarto.deb # render the website @@ -96,8 +96,8 @@ jobs: ref: main_pr_test - name: gh-cli-pr run: | - gh auth login --with-token < $( echo ${{ secrets.GH_PAT }} ) && \ - gh pr create -B $BASE -H ${{ github.ref_name }} --title "PR for ${github.sha::7} on RUN_ID ${{ github.run_id }}" --draft && \ + echo ${{ secrets.GH_PAT }} | gh auth login --with-token && \ + gh pr create -B $BASE -H ${{ github.ref_name }} --title "PR for ${{ github.sha }} on RUN_ID ${{ github.run_id }}" --draft && \ gh auth logout # - name: gh-cli-pr # run: From f2aee9657708779db4d5d25f139b09f742029706 Mon Sep 17 00:00:00 2001 From: jennylsmith Date: Tue, 25 Feb 2025 16:07:54 -0800 Subject: [PATCH 38/38] added --body argument to pr --- .github/workflows/quarto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quarto.yml b/.github/workflows/quarto.yml index 372651c..3e290f9 100644 --- a/.github/workflows/quarto.yml +++ b/.github/workflows/quarto.yml @@ -97,7 +97,7 @@ jobs: - name: gh-cli-pr run: | echo ${{ secrets.GH_PAT }} | gh auth login --with-token && \ - gh pr create -B $BASE -H ${{ github.ref_name }} --title "PR for ${{ github.sha }} on RUN_ID ${{ github.run_id }}" --draft && \ + gh pr create -B $BASE -H ${{ github.ref_name }} --title "PR for ${{ github.sha }} on RUN_ID ${{ github.run_id }}" --body "PR for ${{ github.sha }}" --draft && \ gh auth logout # - name: gh-cli-pr # run: