diff --git a/.circleci/config.yml b/.circleci/config.yml index 4ff0ead..b5c8004 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ parameters: jobs: docker-build-arm: machine: - image: ubuntu-2004:2022.04.1 + image: default resource_class: arm.medium environment: @@ -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: diff --git a/.github/workflows/build-publish-fenics.yml b/.github/workflows/build-publish-fenics.yml index f786f6e..31d6b71 100644 --- a/.github/workflows/build-publish-fenics.yml +++ b/.github/workflows/build-publish-fenics.yml @@ -18,7 +18,7 @@ on: type: string image_description: description: "Description of package" - default: "" + default: "Some description" type: string pull_request: branches: @@ -26,6 +26,7 @@ on: env: REGISTRY: ghcr.io + IMAGE_NAME: fenics jobs: build-and-push-image: @@ -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" @@ -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' }} @@ -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 }}