Skip to content

Docker Images CI

Docker Images CI #2170

Workflow file for this run

name: Docker Images CI
on:
#push:
# branches: [ "master" ]
#pull_request:
# branches: [ "main" ]
#schedule:
#- cron: '30 6 * * *'
workflow_dispatch:
inputs:
baseTag:
description: 'The base image tag to use'
required : true
default : build
oafDist:
description: 'The openaf dist to use'
required : false
default : ''
ubi:
description: 'If defined will build using an ubi base image instead of alpine'
required : false
default : ''
jobs:
build-nattrmon:
needs: build-oaf
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v4
name: Build and push based on input
if : ${{ github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:nAttrMon"
push: true
tags: openaf/nattrmon:${{ github.event.inputs.baseTag }}
build-args: url=openaf/oaf:${{ github.event.inputs.baseTag }}
- uses: docker/build-push-action@v4
name: Build and push
if : ${{ ! github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:nAttrMon"
push: true
tags: openaf/nattrmon:build
build-args: url=openaf/oaf:build
build-oaf:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v4
name: Build and push based on input
if : ${{ github.event.inputs.baseTag && github.event.inputs.ubi != 'yes' }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:openaf"
push: true
tags: openaf/oaf:${{ github.event.inputs.baseTag }}
build-args: |
DIST=${{ github.event.inputs.baseTag }}
OPENAFDIST=${{ github.event.inputs.oafDist }}
- uses: docker/build-push-action@v4
name: Build and push based on input ubi
if : ${{ github.event.inputs.baseTag && github.event.inputs.ubi == 'yes' }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:openaf-ubi"
push: true
tags: openaf/oaf:${{ github.event.inputs.baseTag }}
build-args: |
DIST=${{ github.event.inputs.baseTag }}
OPENAFDIST=${{ github.event.inputs.oafDist }}
- uses: docker/build-push-action@v4
name: Build and push
if : ${{ ! github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:openaf"
push: true
tags: openaf/oaf:build
build-args: DIST=build
build-openaf:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v4
name: Build and push based on input
if : ${{ github.event.inputs.baseTag && github.event.inputs.ubi != 'yes' }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:openaf"
push: true
tags: openaf/openaf:${{ github.event.inputs.baseTag }}
build-args: |
DIST=${{ github.event.inputs.baseTag }}
OPENAFDIST=${{ github.event.inputs.oafDist }}
- uses: docker/build-push-action@v4
name: Build and push based on input ubi
if : ${{ github.event.inputs.baseTag && github.event.inputs.ubi == 'yes' }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:openaf-ubi"
push: true
tags: openaf/openaf:${{ github.event.inputs.baseTag }}
build-args: |
DIST=${{ github.event.inputs.baseTag }}
OPENAFDIST=${{ github.event.inputs.oafDist }}
- uses: docker/build-push-action@v4
name: Build and push
if : ${{ ! github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:openaf"
push: true
tags: openaf/openaf:build
build-args: DIST=build
build-openaf-ojobc:
needs: build-openaf
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v4
name: Build and push based on input
if : ${{ github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:oJobC"
push: true
tags: openaf/openaf-ojobc:${{ github.event.inputs.baseTag }}
build-args: |
DIST=${{ github.event.inputs.baseTag }}
OPENAFDIST=${{ github.event.inputs.oafDist }}
- uses: docker/build-push-action@v4
name: Build and push
if : ${{ ! github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:oJobC"
push: true
tags: openaf/openaf-ojobc:build
build-args: DIST=build
build-ojobc:
needs: build-openaf
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v4
name: Build and push based on input
if : ${{ github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:oJobC"
push: true
tags: openaf/ojobc:${{ github.event.inputs.baseTag }}
build-args: |
DIST=${{ github.event.inputs.baseTag }}
OPENAFDIST=${{ github.event.inputs.oafDist }}
- uses: docker/build-push-action@v4
name: Build and push
if : ${{ ! github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:oJobC"
push: true
tags: openaf/ojobc:build
build-args: DIST=build
build-openaf-ojob:
needs: build-openaf
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v4
name: Build and push based on input
if : ${{ github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:oJob"
push: true
tags: openaf/openaf-ojob:${{ github.event.inputs.baseTag }}
build-args: |
DIST=${{ github.event.inputs.baseTag }}
OPENAFDIST=${{ github.event.inputs.oafDist }}
- uses: docker/build-push-action@v4
name: Build and push
if : ${{ ! github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:oJob"
push: true
tags: openaf/openaf-ojob:build
build-args: DIST=build
build-ojob:
needs: build-openaf
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v4
name: Build and push based on input
if : ${{ github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:oJob"
push: true
tags: openaf/ojob:${{ github.event.inputs.baseTag }}
build-args: |
DIST=${{ github.event.inputs.baseTag }}
OPENAFDIST=${{ github.event.inputs.oafDist }}
- uses: docker/build-push-action@v4
name: Build and push
if : ${{ ! github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:oJob"
push: true
tags: openaf/ojob:build
build-args: DIST=build
build-openaf-console:
needs: build-openaf
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v4
name: Build and push based on input
if : ${{ github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:openaf-console"
push: true
tags: openaf/openaf-console:${{ github.event.inputs.baseTag }}
build-args: |
DIST=${{ github.event.inputs.baseTag }}
OPENAFDIST=${{ github.event.inputs.oafDist }}
- uses: docker/build-push-action@v4
name: Build and push
if : ${{ ! github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:openaf-console"
push: true
tags: openaf/openaf-console:build
build-args: DIST=build
build-console:
needs: build-openaf
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v4
name: Build and push based on input
if : ${{ github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:openaf-console"
push: true
tags: openaf/oafc:${{ github.event.inputs.baseTag }}
build-args: |
DIST=${{ github.event.inputs.baseTag }}
OPENAFDIST=${{ github.event.inputs.oafDist }}
- uses: docker/build-push-action@v4
name: Build and push
if : ${{ ! github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:openaf-console"
push: true
tags: openaf/oafc:build
build-args: DIST=build
build-ojobrt:
needs: build-openaf
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v4
name: Build and push based on input
if : ${{ github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:oJobRT"
push: true
tags: openaf/ojobrt:${{ github.event.inputs.baseTag }}
build-args: |
DIST=${{ github.event.inputs.baseTag }}
OPENAFDIST=${{ github.event.inputs.oafDist }}
- uses: docker/build-push-action@v4
name: Build and push
if : ${{ ! github.event.inputs.baseTag }}
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:oJobRT"
push: true
tags: openaf/ojobrt:build
build-args: DIST=build
aws-copy:
name : AWS Copy
runs-on: ubuntu-latest
needs :
- build-oaf
- build-nattrmon
- build-openaf
- build-openaf-ojobc
- build-ojobc
- build-openaf-ojob
- build-ojob
- build-ojobrt
- build-openaf-console
- build-console
steps :
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS }}
aws-secret-access-key: ${{ secrets.AWS_SECRET }}
aws-region: us-east-1
- name: Login to Amazon ECR
id : login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public
- name: Copy to AWS
env :
ECR_REGISTRY : ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: openaf
IMAGE_TAG : ${{ github.event.inputs.baseTag }}
USER : ${{ steps.login-ecr.outputs.docker_username_public_ecr_aws }}
PASS : ${{ steps.login-ecr.outputs.docker_password_public_ecr_aws }}
run : |
docker run --rm nmaguiar/imgutils sudo /bin/sh -c "skopeo login -u $USER -p $PASS $ECR_REGISTRY && skopeo copy --all docker://openaf/oaf:$IMAGE_TAG docker://public.ecr.aws/openaf/oaf:$IMAGE_TAG && skopeo copy --all docker://openaf/openaf:$IMAGE_TAG docker://public.ecr.aws/openaf/openaf:$IMAGE_TAG && skopeo copy --all docker://openaf/openaf-ojobc:$IMAGE_TAG docker://public.ecr.aws/openaf/openaf-ojobc:$IMAGE_TAG && skopeo copy --all docker://openaf/ojobc:$IMAGE_TAG docker://public.ecr.aws/openaf/ojobc:$IMAGE_TAG && skopeo copy --all docker://openaf/openaf-ojob:$IMAGE_TAG docker://public.ecr.aws/openaf/openaf-ojob:$IMAGE_TAG && skopeo copy --all docker://openaf/ojob:$IMAGE_TAG docker://public.ecr.aws/openaf/ojob:$IMAGE_TAG && skopeo copy --all docker://openaf/openaf-console:$IMAGE_TAG docker://public.ecr.aws/openaf/openaf-console:$IMAGE_TAG && skopeo copy --all docker://openaf/oafc:$IMAGE_TAG docker://public.ecr.aws/openaf/oafc:$IMAGE_TAG && skopeo copy --all docker://openaf/ojobrt:$IMAGE_TAG docker://public.ecr.aws/openaf/ojobrt:$IMAGE_TAG && skopeo copy --all docker://openaf/nattrmon:$IMAGE_TAG docker://public.ecr.aws/openaf/nattrmon:$IMAGE_TAG"