Update publish.yml #2
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
--- | |
# Automatically build and publish to the container registry. | |
# This workflow is triggered on changes to the main branch. | |
name: Build and Publish | |
# yamllint disable-line rule:truthy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- '*' | |
concurrency: | |
group: build-and-publish | |
cancel-in-progress: true | |
jobs: | |
# Call the Tag Generator to generate an image tag to use | |
image-tag: | |
name: Get tagged image name | |
uses: ./.github/workflows/image-tag.yml | |
with: | |
image-name: ghcr.io/darpa-askem/mira | |
amd64: | |
runs-on: ubuntu-24.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: Create image and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./docker | |
platforms: linux/amd64 | |
push: true | |
tags: ${{ needs.image-tag.outputs.tagged-image-name }}--amd64 | |
arm64: | |
runs-on: ubuntu-24.04-arm | |
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: Create image and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./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 | |
uses: ./.github/workflows/merge-images.yml | |
with: | |
name: ${{ needs.image-tag.outputs.tagged-image-name }} |