-
Notifications
You must be signed in to change notification settings - Fork 7
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 #24 from whiteducksoftware/feat/unify
feat: multi-arch docker build, update actions, unify
- Loading branch information
Showing
20 changed files
with
137 additions
and
122 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,41 @@ | ||
name: Build & Publish Images to Registry | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- 'update/*' | ||
- 'feature/*' | ||
paths: | ||
- src/** | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
ORGANISATION_NAME: whiteducksoftware | ||
|
||
jobs: | ||
prepare: | ||
name: prepare | ||
runs-on: ubuntu-latest | ||
outputs: | ||
REGISTRY: ${{ env.REGISTRY }} | ||
ORGANISATION_NAME: ${{ env.ORGANISATION_NAME }} | ||
steps: | ||
- name: vars | ||
run: echo "Exposing ENV vars" | ||
api: | ||
name: build | ||
needs: [prepare] | ||
uses: ./.github/workflows/docker-build-api.yml | ||
with: | ||
REGISTRY: ${{ needs.prepare.outputs.REGISTRY }} | ||
ORGANISATION_NAME: ${{ needs.prepare.outputs.ORGANISATION_NAME }} | ||
webapp: | ||
name: build | ||
needs: [prepare] | ||
uses: ./.github/workflows/docker-build-webapp.yml | ||
with: | ||
REGISTRY: ${{ needs.prepare.outputs.REGISTRY }} | ||
ORGANISATION_NAME: ${{ needs.prepare.outputs.ORGANISATION_NAME }} |
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,46 @@ | ||
name: Build & Publish FredApi to Registry | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
### Values from CICD Workflow ### | ||
REGISTRY: | ||
required: true | ||
type: string | ||
description: 'The Container Registry that should be used.' | ||
ORGANISATION_NAME: | ||
type: string | ||
required: true | ||
description: 'The GitHub organisation name that should be used.' | ||
|
||
jobs: | ||
docker-build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write # needed for publishing the patched image to the GitHub Container Registry | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3.0.0 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3.0.0 | ||
with: | ||
registry: ${{ inputs.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push API | ||
uses: docker/build-push-action@v5.1.0 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
context: ./src/FredApi | ||
file: ./src/FredApi/Dockerfile | ||
tags: ${{ inputs.REGISTRY }}/${{ inputs.ORGANISATION_NAME }}/sample-api:latest |
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,50 @@ | ||
name: Build & Publish WebApp to Registry | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
### Values from CICD Workflow ### | ||
REGISTRY: | ||
required: true | ||
type: string | ||
description: 'The Container Registry that should be used.' | ||
ORGANISATION_NAME: | ||
type: string | ||
required: true | ||
description: 'The GitHub organisation name that should be used.' | ||
|
||
jobs: | ||
docker-build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write # needed for publishing the patched image to the GitHub Container Registry | ||
strategy: | ||
matrix: | ||
version: [fred,frida,fred-cap,fred-easter,fred-pirate,fred-xmas,fred-kube,fred-mvp] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3.0.0 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3.0.0 | ||
with: | ||
registry: ${{ inputs.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push the ${{ matrix.version }} version of the WebApp | ||
uses: docker/build-push-action@v5.1.0 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
context: ./src/WebApp | ||
file: ./src/WebApp/Dockerfile | ||
build-args: VERSION_FOLDER=${{ matrix.version }} | ||
tags: ${{ inputs.REGISTRY }}/${{ inputs.ORGANISATION_NAME }}/sample-mvc:${{ matrix.version }} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes