Skip to content

linuxdeploy docker image #98

linuxdeploy docker image

linuxdeploy docker image #98

Workflow file for this run

name: linuxdeploy docker image
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
on:
push:
branches: trunk
paths:
- 'entrypoint.sh'
- 'Dockerfile'
- '**workflows/docker.yml'
workflow_dispatch:
schedule:
- cron: '30 11 20 * *'
env:
DH_REGISTRY_IMAGE: andy5995/linuxdeploy
GHCR_REGISTRY_IMAGE: ghcr.io/andy5995/linuxdeploy-build-helper-container
VERSION: v3
jobs:
build:
runs-on: ${{ matrix.os }}
name: ${{ matrix.codename }}-${{ matrix.os }}-image
strategy:
matrix:
os:
- ubuntu-24.04-arm
- ubuntu-24.04
codename:
- jammy
fail-fast: true
steps:
- name: Prepare
run: |
platform=$(uname -m)
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v5
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DH_REGISTRY_IMAGE }}
${{ env.GHCR_REGISTRY_IMAGE }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.UNCLE_ANDY_DOCKERHUB_ACCESS_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
context: .
build-args: CODENAME=${{ matrix.codename }}
file: ./Dockerfile
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,"name=${{ env.DH_REGISTRY_IMAGE }},${{ env.GHCR_REGISTRY_IMAGE }}",push-by-digest=true,name-canonical=true,push=true
cache-from: type=registry,ref=${{ env.DH_REGISTRY_IMAGE }}:${{ matrix.codename }}-${{ env.PLATFORM_PAIR }}-${{ env.VERSION }}-buildcache
cache-to: type=registry,ref=${{ env.DH_REGISTRY_IMAGE }}:${{ matrix.codename }}-${{ env.PLATFORM_PAIR }}-${{ env.VERSION }}-buildcache,mode=max
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v5
with:
name: digests-${{ matrix.codename }}-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs:
- build
strategy:
matrix:
codename:
- jammy
fail-fast: true
steps:
- name: Download digests
uses: actions/download-artifact@v6
with:
path: /tmp/digests
pattern: digests-${{ matrix.codename }}-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DH_REGISTRY_IMAGE }}
${{ env.GHCR_REGISTRY_IMAGE }}
tags: |
type=raw,value=${{ env.VERSION }}-${{ matrix.codename }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.UNCLE_ANDY_DOCKERHUB_ACCESS_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
for build in ${DH_REGISTRY_IMAGE} ${GHCR_REGISTRY_IMAGE}; do
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf "${build}@sha256:%s " *)
done
- name: Inspect image
run: |
for build in ${DH_REGISTRY_IMAGE} ${GHCR_REGISTRY_IMAGE}; do
docker buildx imagetools inspect ${build}:${{ steps.meta.outputs.version }}
done