From 0fc5e9a222c23d217c1207eb9739a35a3e96e4e6 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 18 Apr 2026 16:45:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0Docker=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E6=89=93=E5=8C=85workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-docker-artifact.yml | 48 +++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/build-docker-artifact.yml diff --git a/.github/workflows/build-docker-artifact.yml b/.github/workflows/build-docker-artifact.yml new file mode 100644 index 000000000..017c3d011 --- /dev/null +++ b/.github/workflows/build-docker-artifact.yml @@ -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