-
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.
Co-authored-by: David Gauldie <dgauldie@uncharted.software>
- Loading branch information
1 parent
93f4ad4
commit d71a577
Showing
11 changed files
with
645 additions
and
191 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,38 @@ | ||
--- | ||
# Create a new tag for the image | ||
name: image-tag.yml | ||
on: | ||
workflow_call: | ||
inputs: | ||
image-name: | ||
required: true | ||
description: 'The name of the image to be built' | ||
type: string | ||
outputs: | ||
tagged-image-name: | ||
description: 'The tagged name of the image to be built' | ||
value: ${{ jobs.image-tag.outputs.name }} | ||
jobs: | ||
image-tag: | ||
name: Define image tag | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
name: ${{ steps.define.outputs.name }} | ||
steps: | ||
- name: Define the final tag based on the branch or tag | ||
id: define | ||
run: | | ||
if [[ '${{ github.ref_type }}' == 'branch' && '${{ github.ref_name }}' == 'main' ]]; then | ||
TAG=latest | ||
else | ||
SEMVER=$( echo ${{ github.ref_name }} | sed -nre 's/^v[^0-9]*(([0-9]+\.)*[0-9]+(-[a-z]+)?).*/\1/p') | ||
if [[ -n $SEMVER ]]; then | ||
TAG=${SEMVER} | ||
else | ||
TAG=${{ github.ref_name }} | ||
fi | ||
fi | ||
IMAGE=${{ inputs.image-name }}:${TAG,,} | ||
echo "$IMAGE" | ||
echo "name=$IMAGE" >> $GITHUB_OUTPUT |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
# Merge AMD64 and ARM64 images into one manifest | ||
name: merge-images.yml | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
required: true | ||
description: 'The name of the image to be merged' | ||
type: string | ||
|
||
jobs: | ||
merge-images: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Login to registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create manifest | ||
run: | | ||
docker manifest create ${{ inputs.name }} \ | ||
--amend ${{ inputs.name }}--amd64 \ | ||
--amend ${{ inputs.name }}--arm64 | ||
docker manifest annotate --arch amd64 --os linux ${{ inputs.name }} ${{ inputs.name }}--amd64 | ||
docker manifest annotate --arch arm64 --os linux ${{ inputs.name }} ${{ inputs.name }}--arm64 | ||
- name: Inspect and push the manifest | ||
run: | | ||
docker manifest inspect ${{ inputs.name }} | ||
docker manifest push ${{ inputs.name }} | ||
- name: Delete the AMD64 and ARM64 manifest | ||
continue-on-error: true | ||
run: | | ||
docker manifest rm ${{ inputs.name }}--amd64 | ||
docker manifest rm ${{ inputs.name }}--arm64 |
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,101 @@ | ||
--- | ||
# Automatically build and publish the client to the container registry. | ||
# This workflow is triggered on changes to the client directory. | ||
|
||
name: Build and Publish hmi-client | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
push: | ||
paths: | ||
- 'packages/client/**' | ||
branches: | ||
- 'main' | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
image-tag: | ||
name: Get tagged image name | ||
uses: ./.github/workflows/image-tag.yml | ||
with: | ||
image-name: ghcr.io/darpa-askem/hmi-client | ||
|
||
amd64: | ||
runs-on: ubuntu-22.04 | ||
needs: image-tag | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Login to registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup Node 20.10.0 LTS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.10.0 | ||
|
||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build hmi-client using Makefile | ||
run: make image-hmi-client | ||
|
||
- name: Create image and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: packages/client/hmi-client/docker | ||
platforms: linux/amd64 | ||
push: true | ||
tags: ${{ needs.image-tag.outputs.tagged-image-name }}--amd64 | ||
|
||
arm64-emulation: | ||
runs-on: ubuntu-22.04 | ||
needs: image-tag | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Login to 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 | ||
|
||
- name: Setup Node 20.10.0 LTS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.10.0 | ||
|
||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build hmi-client using Makefile | ||
run: make image-hmi-client | ||
|
||
- name: Create image and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: packages/client/hmi-client/docker | ||
platforms: linux/arm64 | ||
push: true | ||
tags: ${{ needs.image-tag.outputs.tagged-image-name }}--arm64 | ||
|
||
merge-images: | ||
name: Merge AMD64 and ARM64 images under one manifest | ||
needs: | ||
- image-tag | ||
- amd64 | ||
- arm64-emulation | ||
uses: ./.github/workflows/merge-images.yml | ||
with: | ||
name: ${{ needs.image-tag.outputs.tagged-image-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,114 @@ | ||
--- | ||
# Automatically build and publish the funman-taskrunner to the container registry. | ||
# This workflow is triggered on changes to the funman-taskrunner directory. | ||
|
||
name: Build and Publish funman-taskrunner | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
push: | ||
paths: | ||
- 'packages/taskrunner/**' | ||
- 'packages/funman/**' | ||
branches: | ||
- 'main' | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
image-tag: | ||
name: Get tagged image name | ||
uses: ./.github/workflows/image-tag.yml | ||
with: | ||
image-name: ghcr.io/darpa-askem/funman-taskrunner | ||
|
||
amd64: | ||
runs-on: ubuntu-22.04 | ||
needs: image-tag | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Login to registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate GradleW JAR | ||
uses: gradle/actions/wrapper-validation@v3 | ||
|
||
- name: Setup Java v17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
cache: gradle | ||
|
||
- name: Build funman-taskrunner using Makefile | ||
run: make image-funman-taskrunner | ||
|
||
- name: Create image and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./packages/funman/Dockerfile | ||
platforms: linux/amd64 | ||
push: true | ||
tags: ${{ needs.image-tag.outputs.tagged-image-name }}--amd64 | ||
|
||
arm64-emulation: | ||
runs-on: ubuntu-22.04 | ||
needs: image-tag | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Login to 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 | ||
|
||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate GradleW JAR | ||
uses: gradle/actions/wrapper-validation@v3 | ||
|
||
- name: Setup Java v17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
cache: gradle | ||
|
||
- name: Build funman-taskrunner using Makefile | ||
run: make image-funman-taskrunner | ||
|
||
- name: Create image and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./packages/funman/Dockerfile | ||
platforms: linux/arm64 | ||
push: true | ||
tags: ${{ needs.image-tag.outputs.tagged-image-name }}--arm64 | ||
|
||
merge-images: | ||
name: Merge AMD64 and ARM64 images under one manifest | ||
needs: | ||
- image-tag | ||
- amd64 | ||
- arm64-emulation | ||
uses: ./.github/workflows/merge-images.yml | ||
with: | ||
name: ${{ needs.image-tag.outputs.tagged-image-name }} |
Oops, something went wrong.