-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add container build workflow Signed-off-by: svrnm <[email protected]> * remove nightly Signed-off-by: svrnm <[email protected]> * add dev workflow Signed-off-by: svrnm <[email protected]> * update check to run on pull request target Signed-off-by: svrnm <[email protected]> * use ubuntu 24.04 Signed-off-by: svrnm <[email protected]> * manage versions better Signed-off-by: svrnm <[email protected]> * adjusted directory structure & scripts fo a more clean repo (#10) * move to src Signed-off-by: svrnm <[email protected]> * Update .github/workflows/reusable-build-container-images.yml * Update .github/workflows/reusable-build-container-images.yml --------- Signed-off-by: svrnm <[email protected]> Co-authored-by: Alexander Stoklasa <[email protected]>
- Loading branch information
Showing
4 changed files
with
106 additions
and
0 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,17 @@ | ||
name: Build and publish dev container images | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- 'src/loaders/**' | ||
- 'src/services/**' | ||
- '.version' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/reusable-build-container-images.yml | ||
with: | ||
push: true | ||
release_stream: dev |
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,16 @@ | ||
name: Check container builds | ||
|
||
on: | ||
pull_request_target: | ||
branches: [ main ] | ||
paths: | ||
- 'src/loaders/**' | ||
- 'src/services/**' | ||
- '.version' | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/reusable-build-container-images.yml | ||
with: | ||
push: false | ||
release_stream: dev |
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,13 @@ | ||
name: Build and publish release container images | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/reusable-build-container-images.yml | ||
with: | ||
push: true | ||
release_stream: latest | ||
secrets: inherit |
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,60 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
push: | ||
description: Set to true to push images to registries | ||
default: false | ||
required: false | ||
type: boolean | ||
release_stream: | ||
type: string | ||
description: Set the release stream (latest, dev, ...) | ||
required: false | ||
default: dev | ||
registry_ghcr: | ||
description: github container registry | ||
default: 'ghcr.io/cisco-open/app-simulator' | ||
required: false | ||
type: string | ||
jobs: | ||
build: | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
matrix: | ||
image: | ||
- context: ./src/loaders/curl | ||
name: loaders-curl | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Bump version | ||
# Only bump the version if the release stream is not 'latest' | ||
# This way we make sure that released versions are fixed to their version | ||
# and that 'dev' or other non stable releases do not overwrite. | ||
if: ${{ inputs.release_stream != 'latest' }} | ||
run: ./scripts/bumpversion.sh --patch | ||
- name: Read version from .version file | ||
id: version | ||
run: echo "::set-output name=version::$(cat .version)" | ||
- name: Log into GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: arm64, amd64 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build and push images | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ${{ matrix.image.context }} | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ inputs.push }} | ||
tags: | | ||
${{ inputs.registry_ghcr }}-${{ matrix.image.name }}:${{ steps.version.outputs.version }} | ||
${{ inputs.registry_ghcr }}-${{ matrix.image.name }}:${{ inputs.release_stream }} |