Skip to content

Commit

Permalink
Merge pull request #23 from scientificcomputing/finsberg/fix-failed-a…
Browse files Browse the repository at this point in the history
…rm-image

Set default description to something non-empty
  • Loading branch information
finsberg authored May 28, 2024
2 parents a2b8c61 + 1964c31 commit 962b38e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
5 changes: 2 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ parameters:
jobs:
docker-build-arm:
machine:
image: ubuntu-2004:2022.04.1
image: default
resource_class: arm.medium

environment:
Expand Down Expand Up @@ -62,8 +62,7 @@ jobs:
- run:
name: merge manifests to publish multi-arch build
command: |
docker manifest create --insecure "$IMAGE" --amend "$IMAGE" --amend "${ARM_IMAGE}"
docker manifest push "$IMAGE"
docker buildx imagetools create --append "$IMAGE" --append "${ARM_IMAGE}" --tag "$IMAGE"
# deleting manifest doesn't work yet, but at least the temporary arm package is private
# - run:
Expand Down
34 changes: 15 additions & 19 deletions .github/workflows/build-publish-fenics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ on:
type: string
image_description:
description: "Description of package"
default: ""
default: "Some description"
type: string
pull_request:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: fenics

jobs:
build-and-push-image:
Expand All @@ -51,16 +52,20 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker (testing)
id: meta-testing
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
labels: |
org.opencontainers.image.title=${{ github.run_id }}-${{ github.run_attempt }}
org.opencontainers.image.description="Test run"
images: test-image-${{ github.run_id }}-${{ github.run_attempt }}
org.opencontainers.image.title=${{ github.event.inputs.image_name || env.IMAGE_NAME }}
org.opencontainers.image.description=${{ github.event.inputs.image_description }}
- name: Build (FEniCS) AMD docker image
images: ${{ github.GITHUB_REPOSITORY }}/${{ github.event.inputs.image_name || env.IMAGE_NAME }}
tags: |
type=raw,value=${{ github.event.inputs.release_tag }}
- name: Build AMD docker image
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:fenics"
Expand All @@ -69,20 +74,10 @@ jobs:
platforms: linux/amd64
tags: ${{ steps.meta-testing.outputs.tags }}
labels: ${{ steps.meta-testing.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.inputs.image_name }}:${{ github.event.inputs.release_tag }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.inputs.image_name || env.IMAGE_NAME }}:${{ github.event.inputs.release_tag }}
cache-to: type=inline

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
labels: |
org.opencontainers.image.title=${{ github.event.inputs.image_name }}
org.opencontainers.image.description=${{ github.event.inputs.image_description }}
images: ${{ github.GITHUB_REPOSITORY }}/${{ github.event.inputs.image_name }}
tags: |
type=raw,value=${{ github.event.inputs.release_tag }}


- name: Trigger circleci build for ARM
if: ${{ github.event_name == 'workflow_dispatch' }}
Expand All @@ -104,6 +99,7 @@ jobs:
with:
context: "{{defaultContext}}:${{ github.event.inputs.image_name }}"
push: true
provenance: false # removes unknown/unknown manifest
platforms: linux/amd64 #,linux/arm64
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.inputs.image_name }}:${{ github.event.inputs.release_tag }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down

0 comments on commit 962b38e

Please sign in to comment.