-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5a42bf
commit cf6b4ba
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: test | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
docker_image: | ||
description: 'Docker image to pull' | ||
required: true | ||
default: 'alpine:latest' # 你可以设置一个默认值 | ||
|
||
jobs: | ||
pull_and_package: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Pull Docker Image | ||
run: docker pull ${{ github.event.inputs.docker_image }} | ||
|
||
- name: Save Docker Image to TAR | ||
run: docker save ${{ github.event.inputs.docker_image }} -o image.tar | ||
|
||
- name: Compress the TAR file | ||
run: tar -czf image.tar.gz image.tar | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: docker-image-tar | ||
path: image.tar.gz | ||
|