Update test.yml
This commit is contained in:
parent
07e5fcd925
commit
ff6f18f510
.github/workflows
|
@ -1,4 +1,4 @@
|
||||||
name: TEST---
|
name: PPPPP
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
@ -7,27 +7,29 @@ on:
|
||||||
description: 'Comma-separated list of Docker images to pull'
|
description: 'Comma-separated list of Docker images to pull'
|
||||||
required: true
|
required: true
|
||||||
default: 'alpine:latest,ubuntu:latest' # 设置默认的 Docker 镜像列表
|
default: 'alpine:latest,ubuntu:latest' # 设置默认的 Docker 镜像列表
|
||||||
|
platforms:
|
||||||
|
description: 'Comma-separated list of platforms to package'
|
||||||
|
required: true
|
||||||
|
default: 'amd64,arm64' # 设置默认的平台列表
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pull_and_package:
|
pull_and_package:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
platform: [amd64, arm64] # 在这里定义你希望支持的平台列表
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Pull Docker Images
|
- name: Pull Docker Images and Package
|
||||||
run: |
|
run: |
|
||||||
images="${{ github.event.inputs.docker_images }}"
|
images="${{ github.event.inputs.docker_images }}"
|
||||||
|
platforms="${{ github.event.inputs.platforms }}"
|
||||||
IFS=',' read -r -a image_array <<< "$images"
|
IFS=',' read -r -a image_array <<< "$images"
|
||||||
|
IFS=',' read -r -a platform_array <<< "$platforms"
|
||||||
for image in "${image_array[@]}"; do
|
for image in "${image_array[@]}"; do
|
||||||
for platform in ${{ matrix.platform }}; do
|
for platform in "${platform_array[@]}"; do
|
||||||
docker pull "${image}-${platform}"
|
docker pull "${image}:${platform}"
|
||||||
docker save "${image}-${platform}" -o "${image//\//_}-${platform}.tar"
|
docker save "${image}:${platform}" -o "${image//\//_}-${platform}.tar"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue