build(deps): update quay.io/curl/curl-base docker tag to v8.11.1 (#1592) #4220
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
name: Create and publish a Docker image | |
on: | |
push: | |
branches: ['**'] | |
pull_request: | |
workflow_call: | |
inputs: | |
tag-name: | |
required: true | |
type: string | |
outputs: | |
image_tags: | |
value: ${{ jobs.meta.outputs.tags }} | |
image_url: | |
value: https://ghcr.io/${{ github.repository }} | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
# tool versions | |
# renovate: datasource=github-releases depName=docker/buildx | |
BUILDX_VERSION: v0.19.2 | |
# renovate: datasource=github-releases depName=moby/buildkit | |
BUILDKIT_VERSION: v0.18.1 | |
permissions: {} | |
jobs: | |
env: | |
# release-please によるコミットの時は workflow_call でのみ実行する | |
if: ${{ !( github.workflow == 'Create and publish a Docker image' && startsWith(github.event.head_commit.message, 'release:') && github.event.head_commit.author.name == 'eoeo-release[bot]' ) }} | |
runs-on: ubuntu-latest | |
outputs: | |
REGISTRY_IMAGE: ${{ steps.lowercase.outputs.REGISTRY_IMAGE }} | |
PUSH: ${{ github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch }} | |
steps: | |
- id: lowercase | |
run: | | |
registory_image='${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}' | |
echo "REGISTRY_IMAGE=${registory_image@L}" >> $GITHUB_OUTPUT | |
meta: | |
needs: [env] | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.meta.outputs.version}} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.labels.outputs.labels }} | |
json: ${{ steps.meta.outputs.json }} | |
steps: | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 | |
with: | |
images: ${{ needs.env.outputs.REGISTRY_IMAGE }} | |
tags: | | |
type=semver,pattern={{version}},value=${{ inputs.tag-name }} | |
type=semver,pattern={{major}}.{{minor}},value=${{ inputs.tag-name }} | |
type=semver,pattern={{major}},value=${{ inputs.tag-name }} | |
type=edge | |
type=ref,event=branch | |
- name: Delete org.opencontainers.image.licenses label | |
id: labels | |
run: | | |
cat << EOS >> "$GITHUB_OUTPUT" | |
labels<<EOF | |
$(echo '${{ steps.meta.outputs.labels }}' | sed '/^org.opencontainers.image.licenses=/d') | |
EOF | |
EOS | |
build: | |
permissions: | |
packages: write | |
needs: [env, meta] | |
runs-on: ubuntu-24.04 | |
outputs: | |
digest: ${{ steps.build.outputs.digest }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- linux/amd64 | |
- linux/arm64 | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 | |
with: | |
version: ${{ env.BUILDX_VERSION }} | |
driver-opts: image=moby/buildkit:${{ env.BUILDKIT_VERSION }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push by digest | |
id: build | |
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 | |
with: | |
platforms: ${{ matrix.platform }} | |
labels: ${{ needs.meta.outputs.labels }} | |
outputs: type=image,name=${{ needs.env.outputs.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ fromJson(needs.env.outputs.PUSH) }} | |
cache-from: type=gha,scope=buildkit-${{ matrix.platform }} | |
cache-to: type=gha,scope=buildkit-${{ matrix.platform }},mode=max | |
- id: export-digest | |
if: ${{ fromJson(needs.env.outputs.PUSH) }} | |
name: Export digest | |
run: | | |
mkdir -p /tmp/digests | |
digest="${{ steps.build.outputs.digest }}" | |
touch "/tmp/digests/${digest#sha256:}" | |
- id: prepare | |
if: ${{ steps.export-digest.conclusion == 'success' }} | |
name: Prepare | |
run: | | |
platform=${{ matrix.platform }} | |
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_OUTPUT | |
- if: ${{ steps.export-digest.conclusion == 'success' }} | |
name: Upload digest | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: digests-${{ steps.prepare.outputs.PLATFORM_PAIR }} | |
path: /tmp/digests/* | |
if-no-files-found: error | |
retention-days: 1 | |
merge: | |
permissions: | |
packages: write | |
needs: [env, meta, build] | |
if: ${{ fromJson(needs.env.outputs.PUSH) }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download digests | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
path: /tmp/digests | |
pattern: digests-* | |
merge-multiple: true | |
- name: Log in to the Container registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create manifest list and push | |
working-directory: /tmp/digests | |
env: | |
DOCKER_METADATA_OUTPUT_JSON: ${{ needs.meta.outputs.json }} | |
run: | | |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | |
$(printf '${{ needs.env.outputs.REGISTRY_IMAGE }}@sha256:%s ' *) | |
- name: Inspect image | |
run: | | |
docker buildx imagetools inspect ${{ needs.env.outputs.REGISTRY_IMAGE }}:${{ needs.meta.outputs.version }} | |
build-migrate: | |
permissions: | |
packages: write | |
needs: [env] | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 | |
with: | |
version: ${{ env.BUILDX_VERSION }} | |
driver-opts: image=moby/buildkit:${{ env.BUILDKIT_VERSION }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: migrate-meta | |
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 | |
with: | |
images: ${{ needs.env.outputs.REGISTRY_IMAGE }} | |
tags: | | |
type=semver,pattern={{version}},value=${{ inputs.tag-name }},suffix=-migrate | |
type=semver,pattern={{major}}.{{minor}},value=${{ inputs.tag-name }},suffix=-migrate | |
type=semver,pattern={{major}},value=${{ inputs.tag-name }},suffix=-migrate | |
type=edge,suffix=-migrate | |
type=ref,event=branch,suffix=-migrate | |
- name: Build and push Docker image | |
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 | |
with: | |
file: 'migrate.Dockerfile' | |
push: ${{ fromJson(needs.env.outputs.PUSH) }} | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.migrate-meta.outputs.tags }} | |
labels: ${{ steps.migrate-meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |