From 394d78cd2c9f4692ac1916c1e661882b7c5ac698 Mon Sep 17 00:00:00 2001 From: Lars Gersmann Date: Wed, 30 Oct 2024 10:53:16 +0100 Subject: [PATCH] chore: update GH workflows by adding documentation and removing unused files --- .../workflows/build-devcontainer-image.yaml | 9 +++- .../manual-dump-github-variables.yaml | 47 ------------------- .../workflows/manual-test-devcontainer.yaml | 33 ------------- .github/workflows/release.yaml | 7 +++ 4 files changed, 15 insertions(+), 81 deletions(-) delete mode 100644 .github/workflows/manual-dump-github-variables.yaml delete mode 100644 .github/workflows/manual-test-devcontainer.yaml diff --git a/.github/workflows/build-devcontainer-image.yaml b/.github/workflows/build-devcontainer-image.yaml index 7418e84..0df556b 100644 --- a/.github/workflows/build-devcontainer-image.yaml +++ b/.github/workflows/build-devcontainer-image.yaml @@ -1,7 +1,14 @@ +# +# this is a shared workflow that is used by other workflows +# +# its primary purpose is to build and push the devcontainer. +# it returns the image name +# +# @see ./release.yaml for how it is used +# name: Build DevContainer Image on: workflow_call: - # secrets: # GITHUB_TOKEN: # required: true diff --git a/.github/workflows/manual-dump-github-variables.yaml b/.github/workflows/manual-dump-github-variables.yaml deleted file mode 100644 index 780ae4f..0000000 --- a/.github/workflows/manual-dump-github-variables.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# this workflow is just for debugging/development purposes and not needed for the actual workflow -name: manual dump github variables -on: - workflow_dispatch: - -jobs: - dump: - runs-on: ubuntu-latest - steps: - - name: checkout branch from git - uses: actions/checkout@v4 - - - uses: ./.github/shared/actions/devcontainer-image-name - id: image_name - - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Dump job context - env: - JOB_CONTEXT: ${{ toJson(job) }} - run: echo "$JOB_CONTEXT" - - name: Dump steps context - env: - STEPS_CONTEXT: ${{ toJson(steps) }} - run: echo "$STEPS_CONTEXT" - - name: Dump runner context - env: - RUNNER_CONTEXT: ${{ toJson(runner) }} - run: echo "$RUNNER_CONTEXT" - - name: Dump strategy context - env: - STRATEGY_CONTEXT: ${{ toJson(strategy) }} - run: echo "$STRATEGY_CONTEXT" - - name: Dump matrix context - env: - MATRIX_CONTEXT: ${{ toJson(matrix) }} - run: echo "$MATRIX_CONTEXT" - - - name: Show default environment variables - run: | - echo "The job_id is: $GITHUB_JOB" # reference the default environment variables - echo "The id of this action is: $GITHUB_ACTION" # reference the default environment variables - echo "The run id is: $GITHUB_RUN_ID" - echo "The GitHub Actor's username is: $GITHUB_ACTOR" - echo "GitHub SHA: $GITHUB_SHA" diff --git a/.github/workflows/manual-test-devcontainer.yaml b/.github/workflows/manual-test-devcontainer.yaml deleted file mode 100644 index 07f0e47..0000000 --- a/.github/workflows/manual-test-devcontainer.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: 'manual test devcontainer image' -on: - # can only be triggered manually - workflow_dispatch: - inputs: - additionalTestCmd: - description: 'A shell expression to run after the default test commands' - required: true - default: 'echo "WP_ENV_HOME=${WP_ENV_HOME} !"' - -jobs: - # build-devcontainer-image-if-outdated: - # uses: ./.github/workflows/build-devcontainer.yml - - test: - runs-on: ubuntu-latest - steps: - - - name: checkout branch from git - uses: actions/checkout@v4 - - - uses: ./.github/shared/actions/devcontainer-image-name - id: image_name - - - name: use devcontainer image - uses: devcontainers/ci@v0.3 - with: - push: never - # use the image_name output variable produced by ./.github/shared/devcontainer-image-name.yaml - cacheFrom: ${{ steps.image_name.outputs.image_name }} - - runCmd: | - ${{ github.event.inputs.additionalTestCmd }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e0a9701..21d5f59 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,3 +1,10 @@ +# +# this is the release workflow that is triggered by a push to main or develop branches +# it will +# - build the project +# - @TODO: save the artifacts to the workflow +# - @TODO: create a GitHub releases with changelog and upload the artifacts +# name: 'release' on: