diff --git a/.github/workflows/push_image.yml b/.github/workflows/push_image.yml index 52db22d69..32b3d1257 100644 --- a/.github/workflows/push_image.yml +++ b/.github/workflows/push_image.yml @@ -14,7 +14,34 @@ on: default: "latest" jobs: + prepare-ui: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22.19.0 + + - name: Build UI + run: | + echo "VITE_APP_VERSION=${GITHUB_REF#refs/tags/}" > ./ui/.env + npm --prefix=./ui ci + npm --prefix=./ui run build + + - name: Upload UI build artifacts + uses: actions/upload-artifact@v4 + with: + name: ui-build + path: ./ui/dist + retention-days: 1 + build-and-push: + needs: prepare-ui runs-on: ubuntu-latest steps: - name: Checkout code @@ -52,15 +79,22 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Inject tag version of UI - run: | - echo "VITE_APP_VERSION=${GITHUB_REF#refs/tags/}" > ./ui/.env + # - name: Inject tag version of UI + # run: | + # echo "VITE_APP_VERSION=${GITHUB_REF#refs/tags/}" > ./ui/.env + + - name: Download UI build artifacts + uses: actions/download-artifact@v4 + with: + name: ui-build + path: ./ui/dist - name: Build and push Docker image uses: docker/build-push-action@v6 with: context: . - file: ./Dockerfile - platforms: linux/amd64,linux/arm64 + # file: ./Dockerfile + file: ./Dockerfile.gh + platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/push_image_next.yml b/.github/workflows/push_image_next.yml index 5f167b1c8..90d3f8916 100644 --- a/.github/workflows/push_image_next.yml +++ b/.github/workflows/push_image_next.yml @@ -77,9 +77,9 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Inject tag version of UI - run: | - echo "VITE_APP_VERSION=${GITHUB_REF#refs/tags/}" > ./ui/.env + # - name: Inject tag version of UI + # run: | + # echo "VITE_APP_VERSION=${GITHUB_REF#refs/tags/}" > ./ui/.env - name: Download UI build artifacts uses: actions/download-artifact@v4 @@ -91,6 +91,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . + # file: ./Dockerfile.gh file: ./Dockerfile.gh platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true