-
Notifications
You must be signed in to change notification settings - Fork 11.3k
43 lines (37 loc) · 1.27 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: AAAA
on:
workflow_dispatch:
inputs:
docker_images:
description: 'Comma-separated list of Docker images to pull'
required: true
default: 'alpine:latest,ubuntu:latest' # 设置默认的 Docker 镜像列表
platforms:
description: 'Comma-separated list of platforms to package'
required: true
default: 'linux/amd64,linux/arm64' # 设置默认的平台列表
jobs:
pull_and_package:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Pull Docker Images and Package
run: |
images="${{ github.event.inputs.docker_images }}"
platforms="${{ github.event.inputs.platforms }}"
IFS=',' read -r -a image_array <<< "$images"
IFS=',' read -r -a platform_array <<< "$platforms"
for image in "${image_array[@]}"; do
for platform in "${platform_array[@]}"; do
docker pull "${image}" --platform "${platform}"
docker save "${image}" -o "${image}.tar"
done
done
- name: Compress the TAR files
run: tar -czf images.tar.gz *.tar
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: docker-images-tar
path: images.tar.gz