chore(deps): bump ubuntu from jammy-20231128 to jammy-20240227 in /ubuntu-22.04 #69
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: docker | |
on: | |
push: | |
branches: | |
- main | |
pull_request: ~ | |
release: | |
types: | |
- published | |
env: | |
REPOSITORY: 'ghcr.io/s6n-labs/docker-runner-images' | |
APT_UBUNTU_MIRROR: 'http://jp.ports.ubuntu.com/ubuntu-ports/' | |
jobs: | |
build: | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
os: | |
- ubuntu-22.04 | |
- ubuntu-23.04 | |
architecture: | |
- ARM64 | |
- X64 | |
include: | |
- architecture: ARM64 | |
platforms: linux/arm64/v8 | |
runner: buildjet-4vcpu-ubuntu-2204-arm | |
suffix: arm64 | |
- architecture: X64 | |
platforms: linux/amd64 | |
runner: buildjet-4vcpu-ubuntu-2204 | |
suffix: amd64 | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to GHCR | |
run: echo "${{ github.token }}" | docker login ghcr.io -u $ --password-stdin | |
- name: Get shorter hash of the commit | |
id: shorter_hash | |
run: echo "hash=$(echo ${GITHUB_SHA} | cut -c1-7)" >> ${GITHUB_OUTPUT} | |
- name: Build (minimal) | |
uses: docker/build-push-action@v4 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
provenance: false | |
file: './${{ matrix.os }}/Dockerfile' | |
target: 'minimal' | |
build-args: 'APT_UBUNTU_MIRROR=${{ env.APT_UBUNTU_MIRROR }}' | |
tags: | | |
${{ env.REPOSITORY }}:${{ matrix.os }}-minimal-${{ steps.shorter_hash.outputs.hash }}-${{ matrix.suffix }} | |
${{ env.REPOSITORY }}:${{ matrix.os }}-minimal-${{ github.event.release.tag_name || 'latest' }}-${{ matrix.suffix }} | |
${{ env.REPOSITORY }}:${{ matrix.os }}-minimal-${{ matrix.suffix }} | |
- name: Build (standard) | |
uses: docker/build-push-action@v4 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
provenance: false | |
file: './${{ matrix.os }}/Dockerfile' | |
target: 'standard' | |
build-args: 'APT_UBUNTU_MIRROR=${{ env.APT_UBUNTU_MIRROR }}' | |
tags: | | |
${{ env.REPOSITORY }}:${{ matrix.os }}-standard-${{ steps.shorter_hash.outputs.hash }}-${{ matrix.suffix }} | |
${{ env.REPOSITORY }}:${{ matrix.os }}-standard-${{ github.event.release.tag_name || 'latest' }}-${{ matrix.suffix }} | |
${{ env.REPOSITORY }}:${{ matrix.os }}-standard-${{ matrix.suffix }} | |
- name: Build (dind) | |
uses: docker/build-push-action@v4 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
provenance: false | |
file: './${{ matrix.os }}/Dockerfile' | |
target: 'dind' | |
build-args: 'APT_UBUNTU_MIRROR=${{ env.APT_UBUNTU_MIRROR }}' | |
tags: | | |
${{ env.REPOSITORY }}:${{ matrix.os }}-dind-${{ steps.shorter_hash.outputs.hash }}-${{ matrix.suffix }} | |
${{ env.REPOSITORY }}:${{ matrix.os }}-dind-${{ github.event.release.tag_name || 'latest' }}-${{ matrix.suffix }} | |
${{ env.REPOSITORY }}:${{ matrix.os }}-dind-${{ matrix.suffix }} | |
outputs: | |
shorter_hash: '${{ steps.shorter_hash.outputs.hash }}' | |
combine: | |
needs: | |
- build | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
os: | |
- ubuntu-22.04 | |
- ubuntu-23.04 | |
variant: | |
- minimal | |
- standard | |
- dind | |
runs-on: ubuntu-22.04 | |
if: ${{ github.event_name != 'pull_request' }} | |
steps: | |
- name: Log in to GHCR | |
run: echo "${{ github.token }}" | docker login ghcr.io -u $ --password-stdin | |
- name: Determine the prefix of tags | |
id: tag_prefix | |
run: | | |
echo "commitish=${REPOSITORY}:${{ matrix.os }}-${{ matrix.variant }}-${{ needs.build.outputs.shorter_hash }}" >> "${GITHUB_OUTPUT}" | |
echo "versioned=${REPOSITORY}:${{ matrix.os }}-${{ matrix.variant }}-${{ github.event.release.tag_name || 'latest' }}" >> "${GITHUB_OUTPUT}" | |
- name: Create and push multi-arch image manifests | |
run: | | |
for TAG in '${{ steps.tag_prefix.outputs.commitish }}' '${{ steps.tag_prefix.outputs.versioned }}'; do | |
docker manifest create "${TAG}" --amend "${TAG}-amd64" --amend "${TAG}-arm64" | |
docker manifest push "${TAG}" | |
done |