-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from cyber-dojo/make-main-workflow-reusable
Make main workflow reuseable
- Loading branch information
Showing
9 changed files
with
142 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Base Image Update | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
base_image: | ||
description: "Image-Tag for cyberdojo/docker-base (short commit SHA - first 7 digits) eg edb2887" | ||
required: true | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
base_image: ${{ steps.vars.outputs.base_image }} | ||
kosli_trail: ${{ steps.vars.outputs.kosli_trail }} | ||
steps: | ||
- name: Outputs | ||
id: vars | ||
run: | | ||
echo "base_image=cyberdojo/docker-base:${{ inputs.base_image }}" >> ${GITHUB_OUTPUT} | ||
echo "kosli_trail=base-image-update-${{ inputs.base_image }}" >> ${GITHUB_OUTPUT} | ||
trigger: | ||
needs: [setup] | ||
uses: ./.github/workflows/main.yml | ||
with: | ||
BASE_IMAGE: ${{ needs.setup.outputs.base_image }} | ||
KOSLI_TRAIL: ${{ needs.setup.outputs.kosli_trail }} | ||
secrets: | ||
DOCKER_USER: ${{ secrets.DOCKER_USER }} | ||
DOCKER_PASS: ${{ secrets.DOCKER_PASS }} | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Main | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
get-base-image: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
base_image: ${{ steps.vars.outputs.base_image }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Output the base-image | ||
id: vars | ||
run: | | ||
source ./bin/lib.sh | ||
echo "base_image=$(echo_base_image)" >> ${GITHUB_OUTPUT} | ||
trigger: | ||
needs: [get-base-image] | ||
uses: ./.github/workflows/main.yml | ||
with: | ||
BASE_IMAGE: ${{ needs.get-base-image.outputs.base_image }} | ||
KOSLI_TRAIL: ${{ github.sha }} | ||
secrets: | ||
DOCKER_USER: ${{ secrets.DOCKER_USER }} | ||
DOCKER_PASS: ${{ secrets.DOCKER_PASS }} | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters