mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-12-26 00:52:46 +00:00
Use arm64 runner instead of QEMU
Some checks are pending
docker-images / multi (., tunasync-scripts, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (., tunasync-scripts, ubuntu-latest) (push) Waiting to run
docker-images / multi (ftpsync, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (ftpsync, ubuntu-latest) (push) Waiting to run
docker-images / multi (nix-channels, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (nix-channels, ubuntu-latest) (push) Waiting to run
docker-images / multi (pub-mirror, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (pub-mirror, ubuntu-latest) (push) Waiting to run
docker-images / multi (rubygems-mirror, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (rubygems-mirror, ubuntu-latest) (push) Waiting to run
docker-images / multi (rustup-mirror, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (rustup-mirror, ubuntu-latest) (push) Waiting to run
docker-images / multi (shadowmire, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (shadowmire, ubuntu-latest) (push) Waiting to run
docker-images / multi (tsumugu, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (tsumugu, ubuntu-latest) (push) Waiting to run
docker-images / merge (push) Blocked by required conditions
Some checks are pending
docker-images / multi (., tunasync-scripts, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (., tunasync-scripts, ubuntu-latest) (push) Waiting to run
docker-images / multi (ftpsync, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (ftpsync, ubuntu-latest) (push) Waiting to run
docker-images / multi (nix-channels, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (nix-channels, ubuntu-latest) (push) Waiting to run
docker-images / multi (pub-mirror, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (pub-mirror, ubuntu-latest) (push) Waiting to run
docker-images / multi (rubygems-mirror, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (rubygems-mirror, ubuntu-latest) (push) Waiting to run
docker-images / multi (rustup-mirror, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (rustup-mirror, ubuntu-latest) (push) Waiting to run
docker-images / multi (shadowmire, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (shadowmire, ubuntu-latest) (push) Waiting to run
docker-images / multi (tsumugu, ubuntu-24.04-arm) (push) Waiting to run
docker-images / multi (tsumugu, ubuntu-latest) (push) Waiting to run
docker-images / merge (push) Blocked by required conditions
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
This commit is contained in:
parent
b2e66bdb6b
commit
82265fbd6f
|
|
@ -2,11 +2,11 @@ name: docker-images
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- docker-test
|
- docker-test
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- docker-test
|
- docker-test
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
@ -16,7 +16,7 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image:
|
image:
|
||||||
- ftpsync
|
- ftpsync
|
||||||
- nix-channels
|
- nix-channels
|
||||||
- pub-mirror
|
- pub-mirror
|
||||||
|
|
@ -24,44 +24,33 @@ jobs:
|
||||||
- rustup-mirror
|
- rustup-mirror
|
||||||
- shadowmire
|
- shadowmire
|
||||||
- tsumugu
|
- tsumugu
|
||||||
|
- tunasync-scripts
|
||||||
# - freighter
|
# - freighter
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- ubuntu-24.04-arm
|
||||||
include:
|
include:
|
||||||
- image: tunasync-scripts
|
- image: tunasync-scripts
|
||||||
dockerfile: .
|
dockerfile_dir: .
|
||||||
# - image: julia-mirror
|
# - image: julia-mirror
|
||||||
# dockerfile: dockerfiles/julia
|
# dockerfile: dockerfiles/julia
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Determin docker tag
|
name: Determine dockerfile dir
|
||||||
|
id: docker_file_dir
|
||||||
env:
|
env:
|
||||||
TAG_NAME: ${{ github.ref }}
|
DF: ${{ matrix.dockerfile_dir }}
|
||||||
run: |
|
|
||||||
if [ "${TAG_NAME##*/}" = "master" ]; then
|
|
||||||
tag=latest
|
|
||||||
else
|
|
||||||
tag=build-test
|
|
||||||
fi
|
|
||||||
echo "docker_tag=${tag}" >> $GITHUB_ENV
|
|
||||||
-
|
|
||||||
name: Determin dockerfile
|
|
||||||
env:
|
|
||||||
DF: ${{ matrix.dockerfile }}
|
|
||||||
IMG: ${{ matrix.image }}
|
IMG: ${{ matrix.image }}
|
||||||
run: |
|
run: |
|
||||||
if [ -z "${DF}" ]; then
|
if [ -z "${DF}" ]; then
|
||||||
DF="dockerfiles/${IMG}"
|
DF="dockerfiles/${IMG}"
|
||||||
fi
|
fi
|
||||||
echo "docker_file=${DF}" >> $GITHUB_ENV
|
echo "docker_file_dir=${DF}" >> $GITHUB_OUTPUT
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
with:
|
|
||||||
platforms: arm64
|
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
@ -71,19 +60,21 @@ jobs:
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ matrix.image }}-${{ github.sha }}
|
key: ${{ runner.os }}-${{ runner.arch }}-buildx-${{ matrix.image }}-${{ matrix.os }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-${{ matrix.image }}-
|
${{ runner.os }}-${{ runner.arch }}-buildx-${{ matrix.image }}-${{ matrix.os }}-
|
||||||
|
${{ runner.os }}-${{ runner.arch }}-buildx-${{ matrix.image }}-
|
||||||
-
|
-
|
||||||
name: Cache Docker layers
|
name: Cache Docker layers
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-pr-${{ github.event.pull_request.head.user.login }}-buildx-${{ matrix.image }}-${{ github.sha }}
|
key: ${{ runner.os }}-${{ runner.arch }}-pr-${{ github.event.pull_request.head.user.login }}-buildx-${{ matrix.image }}-${{ matrix.os }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pr-${{ github.event.pull_request.head.user.login }}-buildx-${{ matrix.image }}-
|
${{ runner.os }}-${{ runner.arch }}-pr-${{ github.event.pull_request.head.user.login }}-buildx-${{ matrix.image }}-${{ matrix.os }}-
|
||||||
${{ runner.os }}-buildx-${{ matrix.image }}-
|
${{ runner.os }}-${{ runner.arch }}-buildx-${{ matrix.image }}-${{ matrix.os }}-
|
||||||
|
${{ runner.os }}-${{ runner.arch }}-buildx-${{ matrix.image }}-
|
||||||
-
|
-
|
||||||
name: Cache Docker layers
|
name: Cache Docker layers
|
||||||
if: github.event_name != 'push' && github.event_name != 'pull_request'
|
if: github.event_name != 'push' && github.event_name != 'pull_request'
|
||||||
|
|
@ -99,12 +90,77 @@ jobs:
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
|
id: dockerbuild
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ${{ env.docker_file }}/Dockerfile
|
file: ${{ steps.docker_file_dir.outputs.docker_file_dir }}/Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: ${{ github.event_name == 'push' }}
|
push: ${{ github.event_name == 'push' }}
|
||||||
tags: tunathu/${{ matrix.image }}:${{ env.docker_tag }}
|
tags: tunathu/${{ matrix.image }}
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
outputs: ${{ github.event_name == 'push' && 'type=image,push-by-digest=true,name-canonical=true,push=true' || 'type=image' }}
|
||||||
|
-
|
||||||
|
name: Export digest
|
||||||
|
run: |
|
||||||
|
mkdir -p ${{ runner.temp }}/digests/${{ matrix.image }}
|
||||||
|
digest="${{ steps.dockerbuild.outputs.digest }}"
|
||||||
|
touch "${{ runner.temp }}/digests/${{ matrix.image }}/${digest#sha256:}"
|
||||||
|
-
|
||||||
|
name: Upload digest
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: digests-${{ matrix.image }}-${{ matrix.os }}
|
||||||
|
path: ${{ runner.temp }}/digests/*
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
merge:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- multi
|
||||||
|
if: always() && github.event_name == 'push'
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Determine docker tag
|
||||||
|
id: docker_tag
|
||||||
|
env:
|
||||||
|
TAG_NAME: ${{ github.ref }}
|
||||||
|
run: |
|
||||||
|
if [ "${TAG_NAME##*/}" = "master" ]; then
|
||||||
|
tag=latest
|
||||||
|
else
|
||||||
|
tag=build-test
|
||||||
|
fi
|
||||||
|
echo "docker_tag=${tag}" >> $GITHUB_OUTPUT
|
||||||
|
-
|
||||||
|
name: Download digests
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: ${{ runner.temp }}/digests
|
||||||
|
pattern: digests-*
|
||||||
|
merge-multiple: true
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
-
|
||||||
|
name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Create manifest list and push
|
||||||
|
working-directory: ${{ runner.temp }}/digests
|
||||||
|
run: |
|
||||||
|
for i in *; do
|
||||||
|
docker buildx imagetools create -t "tunathu/$i:${{ steps.docker_tag.outputs.docker_tag }}" \
|
||||||
|
$(printf "tunathu/$i@sha256:%s " $(ls $i))
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Inspect images
|
||||||
|
working-directory: ${{ runner.temp }}/digests
|
||||||
|
run: |
|
||||||
|
for i in *; do
|
||||||
|
docker buildx imagetools inspect "tunathu/$i:${{ steps.docker_tag.outputs.docker_tag }}"
|
||||||
|
done
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue