Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions .github/workflows/docker_apply_cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,20 +208,22 @@ jobs:
restore-keys:
${{ github.repository }}/${{ steps.wb-vers.outputs.container-version }}_renv-

trigger-build-deploy:
name: "Trigger Build and Deploy Workflow"
record-cache-result:
name: "Record Caching Status"
runs-on: ubuntu-latest
needs: update-renv-cache
if: |
needs.update-renv-cache.result == 'success' ||
needs.check-renv.outputs.renv-cache-available == 'true'
needs: [check-renv, update-renv-cache]
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: "Record cache result"

- name: "Trigger Build and Deploy Workflow"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run docker_build_deploy.yaml --ref main
echo "${{ needs.update-renv-cache.result == 'success' || needs.check-renv.outputs.renv-cache-available == 'true' || 'false' }}" > ${{ github.workspace }}/apply-cache-result
shell: bash
continue-on-error: true

- name: "Upload cache result"
uses: actions/upload-artifact@v4
with:
name: apply-cache-result
path: ${{ github.workspace }}/apply-cache-result
8 changes: 6 additions & 2 deletions .github/workflows/docker_build_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
- '.github/workbench-docker-version.txt'
schedule:
- cron: '0 0 * * 2'
workflow_run:
workflows: ["03 Maintain: Apply Package Cache"]
types:
- completed
workflow_dispatch:
inputs:
name:
Expand Down Expand Up @@ -72,7 +76,6 @@ jobs:
runs-on: ubuntu-latest
needs: preflight
if: |
always() &&
needs.preflight.outputs.do-build == 'true' &&
needs.preflight.outputs.workbench-update != 'true'
env:
Expand Down Expand Up @@ -127,7 +130,7 @@ jobs:
id: build-and-deploy
uses: carpentries/actions/build-and-deploy@main
with:
reset: ${{ github.event.inputs.reset || 'false' }}
reset: ${{ vars.BUILD_RESET || github.event.inputs.reset || 'false' }}
skip-manage-deps: ${{ github.event.inputs.force-skip-manage-deps == 'true' || steps.build-container-deps.outputs.renv-cache-available || steps.build-container-deps.outputs.backup-cache-used || 'false' }}

update-container-version:
Expand All @@ -150,6 +153,7 @@ jobs:
uses: carpentries/actions/record-container-version@main
with:
CONTAINER_VER: ${{ needs.preflight.outputs.wb-vers }}
AUTO_MERGE: ${{ vars.AUTO_MERGE_CONTAINER_VERSION_UPDATE || 'true' }}
token: ${{ secrets.GITHUB_TOKEN }}
role-to-assume: ${{ secrets.AWS_GH_OIDC_ARN }}
aws-region: ${{ secrets.AWS_GH_OIDC_REGION }}
27 changes: 4 additions & 23 deletions .github/workflows/docker_pr_receive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ permissions:
pull-requests: write

jobs:

preflight:
name: "Preflight: md-outputs exists?"
runs-on: ubuntu-latest
Expand Down Expand Up @@ -49,7 +48,9 @@ jobs:

test-pr:
name: "Record PR number"
if: ${{ github.event.action != 'closed' }} && ${{ needs.preflight.outputs.branch-exists == 'true' }}
if: |
github.event.action != 'closed' &&
needs.preflight.outputs.branch-exists == 'true'
runs-on: ubuntu-latest
needs: preflight
outputs:
Expand Down Expand Up @@ -135,6 +136,7 @@ jobs:
checks: write
contents: write
pages: write
id-token: write
container:
image: ghcr.io/carpentries/workbench-docker:${{ vars.WORKBENCH_TAG || 'latest' }}
env:
Expand Down Expand Up @@ -279,24 +281,3 @@ jobs:
- name: "Teardown"
run: sandpaper::reset_site()
shell: Rscript {0}

pr-checks:
name: "Trigger PR Checks?"
needs:
- test-pr
- build-md-source
runs-on: ubuntu-latest
if: needs.test-pr.outputs.is_valid == 'true'
permissions:
actions: write
checks: write
steps:
- name: "Checkout Lesson"
uses: actions/checkout@v4

- name: "Trigger PR Checks"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run pr-comment.yaml --ref main --field workflow_id=${{ github.run_id }}
shell: bash
Empty file modified .github/workflows/pr-close-signal.yaml
100755 → 100644
Empty file.
36 changes: 10 additions & 26 deletions .github/workflows/pr-comment.yaml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: "Bot: Comment on the Pull Request"
description: "Comment on the pull request with the results of the markdown generation"
on:
workflow_dispatch:
inputs:
workflow_id:
required: true

concurrency:
group: pr-${{ github.event.workflow_run.pull_requests[0].number }}
cancel-in-progress: true
workflow_run:
workflows: ["Bot: Receive Pull Request"]
types:
- completed

jobs:
# Pull requests are valid if:
Expand All @@ -18,16 +14,6 @@ jobs:
test-pr:
name: "Test if pull request is valid"
runs-on: ubuntu-latest
if: >
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'workflow_run' &&
(
github.event.workflow_run.event == 'pull_request' ||
github.event.workflow_run.event == 'workflow_dispatch'
) &&
github.event.workflow_run.conclusion == 'success'
)
outputs:
is_valid: ${{ steps.check-pr.outputs.VALID }}
payload: ${{ steps.check-pr.outputs.payload }}
Expand All @@ -38,7 +24,7 @@ jobs:
id: dl
uses: carpentries/actions/download-workflow-artifact@main
with:
run: ${{ github.event.workflow_run.id || inputs.workflow_id }}
run: ${{ github.event.workflow_run.id }}
name: 'pr'

- name: "Get PR Number"
Expand Down Expand Up @@ -79,11 +65,9 @@ jobs:

- name: "Skip checks for Workbench version file updates"
if: steps.changed-files.outputs.only_version_file == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Only workbench-docker-version.txt changed, skipping preflight checks and running cache update"
gh workflow run update-cache.yaml --ref main
echo "# 🔧 Wait for Next Cache Update #"
echo "Only workbench-docker-version.txt changed."
exit 0
shell: bash

Expand Down Expand Up @@ -138,7 +122,7 @@ jobs:
id: dl
uses: carpentries/actions/download-workflow-artifact@main
with:
run: ${{ github.event.workflow_run.id || inputs.workflow_id }}
run: ${{ github.event.workflow_run.id }}
name: 'built'

- if: steps.dl.outputs.success == 'true'
Expand Down Expand Up @@ -177,7 +161,7 @@ jobs:
id: dl
uses: carpentries/actions/download-workflow-artifact@main
with:
run: ${{ github.event.workflow_run.id || inputs.workflow_id }}
run: ${{ github.event.workflow_run.id }}
name: 'diff'

- if: steps.dl.outputs.success == 'true'
Expand Down Expand Up @@ -210,7 +194,7 @@ jobs:
id: dl
uses: carpentries/actions/download-workflow-artifact@main
with:
run: ${{ github.event.workflow_run.id || inputs.workflow_id }}
run: ${{ github.event.workflow_run.id }}
name: 'built'

- name: "Alert if spoofed"
Expand Down
Empty file modified .github/workflows/pr-post-remove-branch.yaml
100755 → 100644
Empty file.
Empty file modified .github/workflows/pr-preflight.yaml
100755 → 100644
Empty file.
132 changes: 0 additions & 132 deletions .github/workflows/pr-receive.yaml

This file was deleted.

Loading