feat: 添加Docker镜像打包workflow
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
name: Build Docker Image Artifact
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: '镜像标签版本'
|
||||
required: true
|
||||
default: 'latest'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Docker Image
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker Setup Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: node Setup
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Build web
|
||||
run: |
|
||||
cd web
|
||||
npm install --global yarn
|
||||
yarn
|
||||
yarn build
|
||||
cp -r build ../server/resource/
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t next-terminal:${{ github.event.inputs.tag }} .
|
||||
|
||||
- name: Export Docker image
|
||||
run: |
|
||||
docker save next-terminal:${{ github.event.inputs.tag }} | gzip > next-terminal-${{ github.event.inputs.tag }}.tar.gz
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: next-terminal-docker-${{ github.event.inputs.tag }}
|
||||
path: next-terminal-${{ github.event.inputs.tag }}.tar.gz
|
||||
retention-days: 7
|
||||
Reference in New Issue
Block a user