diff --git a/.github/workflows/prodBuilder.yml b/.github/workflows/prodBuilder.yml index 4797ad622..3c491a900 100644 --- a/.github/workflows/prodBuilder.yml +++ b/.github/workflows/prodBuilder.yml @@ -20,6 +20,10 @@ on: required: true DOCKERHUB_TOKEN: required: true + MM_GHT: + required: false + FE_PORT: + required: false jobs: Build: @@ -51,6 +55,9 @@ jobs: ${{ inputs.tags }}:${{ inputs.next_ver }}, ${{ inputs.tags }}:latest cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new + build-args: | + ${{ inputs.myid == 'app' && 'MM_GHT=' || '' }}${{ inputs.myid == 'app' && secrets.MM_GHT || '' }} + ${{ inputs.myid == 'app' && 'PORT=' || '' }}${{ inputs.myid == 'app' && secrets.FE_PORT || '8080' }} - name: Move cache run: | rm -rf /tmp/.buildx-cache diff --git a/.github/workflows/prodci.yml b/.github/workflows/prodci.yml index 235546fba..4cf00d361 100644 --- a/.github/workflows/prodci.yml +++ b/.github/workflows/prodci.yml @@ -9,27 +9,46 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Cache Dependencies + # - name: Cache Dependencies + # uses: actions/cache@v3 + # with: + # path: ~/.npm + # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + # restore-keys: | + # ${{ runner.os }}-node- + # - name: Use NodeJS + # uses: actions/setup-node@v3 + # with: + # node-version: '17.9.1' + - name: Setup Node.js 22 for frontend + uses: actions/setup-node@v3 + with: + node-version: '22' + - name: Enable pnpm for frontend + run: corepack enable && corepack prepare pnpm@latest --activate + - name: Cache pnpm dependencies uses: actions/cache@v3 with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('app/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-node- - - name: Use NodeJS - uses: actions/setup-node@v3 - with: - node-version: '17.9.1' - - name: Install frontend dependencies & test + ${{ runner.os }}-pnpm- + - name: Install frontend dependencies run: | cd app - npm ci - - name: App Coverage Test - run: | - cd app - npm run test:unit -- --coverage + pnpm install --frozen-lockfile env: - CI: true + MM_GHT: ${{ secrets.MM_GHT }} + # - name: Install frontend dependencies & test + # run: | + # cd app + # npm ci + # - name: App Coverage Test + # run: | + # cd app + # npm run test:unit -- --coverage + # env: + # CI: true - name: Zip Frontend App Assets if: github.event_name == 'push' run: | @@ -116,6 +135,8 @@ jobs: secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + MM_GHT: ${{ secrets.MM_GHT }} + FE_PORT: ${{ secrets.FE_PORT }} buildBackendApp: if: github.event_name == 'push' needs: [buildFrontendApp, release]