From 9a49636f634ccbb6a27ad5249a0c918bbaae8a93 Mon Sep 17 00:00:00 2001 From: Jared Tan Date: Mon, 24 Jun 2024 21:00:57 +0800 Subject: [PATCH] chore: fix UI docker build and makes UI/API docker build parallel execution (#563) * try fix UI docker build * parallel execution * polish * polish * polish * update --- .../workflows/docker-build-and-release.yaml | 32 +++++++++++++------ docker/Dockerfile-UI | 2 +- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-build-and-release.yaml b/.github/workflows/docker-build-and-release.yaml index 6cbd066..ace9cde 100644 --- a/.github/workflows/docker-build-and-release.yaml +++ b/.github/workflows/docker-build-and-release.yaml @@ -1,4 +1,4 @@ -name: api-docker-images-build-and-release +name: docker-images-build-and-release on: push: @@ -12,31 +12,25 @@ on: env: # Use docker.io for Docker Hub if empty REGISTRY_SERVER_ADDRESS: ghcr.io/veops + TAG: ${{ github.sha }} jobs: setup-environment: timeout-minutes: 30 runs-on: ubuntu-latest - if: ${{ github.actor != 'dependabot[bot]' }} steps: - name: Checkout Repo uses: actions/checkout@v4 - release-images: + release-api-images: runs-on: ubuntu-latest needs: [setup-environment] permissions: contents: read packages: write timeout-minutes: 90 - env: - TAG: ${{ github.sha }} steps: - name: Checkout Repo uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: "1.21.8" - cache: false - name: Login to GitHub Package Registry uses: docker/login-action@v2 with: @@ -55,6 +49,26 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: ${{ env.REGISTRY_SERVER_ADDRESS }}/cmdb-api:${{ env.TAG }} + release-ui-images: + runs-on: ubuntu-latest + needs: [setup-environment] + permissions: + contents: read + packages: write + timeout-minutes: 90 + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Login to GitHub Package Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Build and push CMDB-UI Docker image uses: docker/build-push-action@v6 with: diff --git a/docker/Dockerfile-UI b/docker/Dockerfile-UI index 75461ea..913c6ee 100644 --- a/docker/Dockerfile-UI +++ b/docker/Dockerfile-UI @@ -1,5 +1,5 @@ # ================================= UI ================================ -FROM node:14.17.3-alpine AS builder +FROM node:16.20 AS builder LABEL description="cmdb-ui"