docker-image构建并打包 #13
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
name: Docker Image CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --tag my-image-name && docker save -o my-image-name.tar my-image-name | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: my-image-name | |
path: x86-64-images.tar.gz | |
retention-days: 1 # 将保留天数设置为 1 天 最多可设置90天 |