Skip to content

Commit

Permalink
GHA: Remove {pre,post}-action steps for self-hosted runners
Browse files Browse the repository at this point in the history
The following hooks:

- ACTIONS_RUNNER_HOOK_JOB_STARTED
- ACTIONS_RUNNER_HOOK_JOB_COMPLETED

could perfectly replace the existing {pre,post}-action scripts
and will make a workflow independent of the runner context.
This commit wipes out all GHA steps where the actions are triggered.

Signed-off-by: Hyounggyu Choi <[email protected]>
  • Loading branch information
BbolroC authored and Xynnn007 committed Jul 31, 2024
1 parent 5e27ab3 commit 4244746
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 48 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/push-as-image-to-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ jobs:
runs-on: ${{ matrix.instance }}

steps:
- name: Take a pre-action for self-hosted runner
run: |
# NOTE: Use file checking instead triggering a step based on a runner type
# to avoid updating the step for each new self-hosted runner.
if [ -f "${HOME}/script/pre_action.sh" ]; then
"${HOME}/script/pre_action.sh" cc-trustee
fi
- name: Checkout code
uses: actions/checkout@v4

Expand All @@ -61,14 +53,6 @@ jobs:
-t "ghcr.io/confidential-containers/staged-images/${{ matrix.tag }}:${commit_sha}-${arch}" \
-t "ghcr.io/confidential-containers/staged-images/${{ matrix.tag }}:latest-${arch}" .
- name: Take a post-action for self-hosted runner
if: always()
run: |
# Please check out the note in the pre-action step for the reason of using file checking
if [ -f "${HOME}/script/post_action.sh" ]; then
"${HOME}/script/post_action.sh" cc-trustee
fi
publish_multi_arch_image:
needs: build_and_push
permissions:
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/push-kbs-client-to-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ jobs:
packages: write

steps:
- name: Take a pre-action for self-hosted runner
run: |
# NOTE: Use file checking instead triggering a step based on a runner type
# to avoid updating the step for each new self-hosted runner.
if [ -f "${HOME}/script/pre_action.sh" ]; then
"${HOME}/script/pre_action.sh" cc-trustee
fi
- name: Check out code
uses: actions/checkout@v4

Expand Down Expand Up @@ -60,11 +52,3 @@ jobs:
if [ "$(uname -m)" = "x86_64" ]; then
oras push ghcr.io/confidential-containers/staged-images/kbs-client:latest kbs-client
fi
- name: Take a post-action for self-hosted runner
if: always()
run: |
# Please check out the note in the pre-action step for the reason of using file checking
if [ -f "${HOME}/script/post_action.sh" ]; then
"${HOME}/script/post_action.sh" cc-trustee
fi
16 changes: 0 additions & 16 deletions .github/workflows/push-kbs-image-to-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ jobs:
runs-on: ${{ matrix.instance }}

steps:
- name: Take a pre-action for self-hosted runner
run: |
# NOTE: Use file checking instead triggering a step based on a runner type
# to avoid updating the step for each new self-hosted runner.
if [ -f "${HOME}/script/pre_action.sh" ]; then
"${HOME}/script/pre_action.sh" cc-trustee
fi
- name: Checkout code
uses: actions/checkout@v4

Expand All @@ -71,14 +63,6 @@ jobs:
-t "ghcr.io/confidential-containers/staged-images/${{ matrix.tag }}:latest-${arch}" \
--build-arg ARCH="${arch}" --build-arg HTTPS_CRYPTO="${https_crypto}" .
- name: Take a post-action for self-hosted runner
if: always()
run: |
# Please check out the note in the pre-action step for the reason of using file checking
if [ -f "${HOME}/script/post_action.sh" ]; then
"${HOME}/script/post_action.sh" cc-trustee
fi
publish_multi_arch_image:
needs: build_and_push
strategy:
Expand Down

0 comments on commit 4244746

Please sign in to comment.