From 9d4848129f6f5cf9356109cbec63900add880fba Mon Sep 17 00:00:00 2001 From: Simon Ding Date: Fri, 13 Dec 2024 13:22:12 +0800 Subject: [PATCH] feat: build flutter use github action --- .github/workflows/go.yml | 13 +++++++++++++ Dockerfile | 8 -------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index eb7beae..422e5d4 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -29,6 +29,19 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GHCR_TOKEN }} + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + flutter-version: 3 + + - name: Build Web + run: | + cd ui + flutter pub get + flutter build web --no-web-resources-cdn + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 diff --git a/Dockerfile b/Dockerfile index 0e5d262..a71f36b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,3 @@ -FROM instrumentisto/flutter:3 AS flutter -WORKDIR /app -COPY ./ui/pubspec.yaml ./ui/pubspec.lock ./ -RUN flutter pub get -COPY ./ui/ ./ -RUN flutter build web --no-web-resources-cdn - -# 打包依赖阶段使用golang作为基础镜像 FROM golang:1.23 as builder # 启用go module