Skip to content

override target arch for arm64 #35

override target arch for arm64

override target arch for arm64 #35

Workflow file for this run

---
# Automatically build Docker images on changes to main and push them to a
# Container Registry using HCL Bake file.
name: Build Docker Images
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
push:
branches: ['develop','demo_*','hackathon_*']
tags: ['*']
pull_request:
branches: ['develop']
permissions:
contents: read
packages: write
jobs:
# Call the Tag Generator to generate an image tag to use
tag-generator:
uses: darpa-askem/.github/.github/workflows/tag-generator.yaml@main
with:
branch: 'develop'
amd64:
name: build-amd64
runs-on: ubuntu-22.04
needs:
- tag-generator
steps:
- name: Set env variables for bakefiles
run: |
# Lowercase the inputs for Docker image naming conventions
TAG=${{ needs.tag-generator.outputs.tag }}
ORG=${{ github.repository_owner }}
# REG=${{ inputs.registry }}
echo "VERSION=${TAG,,}" >> ${GITHUB_ENV}
echo "DOCKER_ORG=${ORG,,}" >> ${GITHUB_ENV}
echo "BUILDX_NO_DEFAULT_ATTESTATIONS=1" >> ${GITHUB_ENV}
# echo "DOCKER_REGISTRY=${REG,,}" >> ${GITHUB_ENV}
- name: Checkout
uses: actions/checkout@v3
- name: Login to registry
uses: docker/login-action@v2
with:
registry: 'ghcr.io'
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# 2.5 - Setup Docker BuildX for multi platform building
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# 2.6 - Build and push Docker Images
- name: Build Images using BuildX Bake
uses: docker/[email protected]
with:
files: |
./docker/docker-bake.hcl
targets: funman-base-amd64
push: true
sbom: false
provenance: false
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
arm64:
name: build-arm64
runs-on: ubuntu-22.04
needs:
- tag-generator
steps:
- name: Set env variables for bakefiles
run: |
# Lowercase the inputs for Docker image naming conventions
TAG=${{ needs.tag-generator.outputs.tag }}
ORG=${{ github.repository_owner }}
# REG=${{ inputs.registry }}
echo "VERSION=${TAG,,}" >> ${GITHUB_ENV}
echo "DOCKER_ORG=${ORG,,}" >> ${GITHUB_ENV}
echo "BUILDX_NO_DEFAULT_ATTESTATIONS=1" >> ${GITHUB_ENV}
# echo "DOCKER_REGISTRY=${REG,,}" >> ${GITHUB_ENV}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Checkout
uses: actions/checkout@v3
- name: Login to registry
uses: docker/login-action@v2
with:
registry: 'ghcr.io'
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# 2.5 - Setup Docker BuildX for multi platform building
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# 2.6 - Build and push Docker Images
- name: Build Images using BuildX Bake
uses: docker/[email protected]
with:
files: |
./docker/docker-bake.hcl
targets: funman-base-arm64
push: true
sbom: false
provenance: false
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
merge-images:
name: Merge AMD64 and ARM64 images under one manifest
needs:
- tag-generator
- amd64
- arm64
uses: ./.github/workflows/merge-images.yml
with:
name: ghcr.io/darpa-askem/funman-base:${{ needs.tag-generator.outputs.tag }}