From 11a30221d442da996b075375d83c6eb17e60de21 Mon Sep 17 00:00:00 2001 From: Kial Jinnah Date: Fri, 20 Oct 2023 11:54:16 -0700 Subject: [PATCH] more pnpm flow fixes Signed-off-by: Kial Jinnah --- .github/actions/firebase/action.yml | 8 +++++++- .github/workflows/ui-cd-pnpm.yaml | 11 +++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/actions/firebase/action.yml b/.github/actions/firebase/action.yml index c9b8de19..12fac290 100644 --- a/.github/actions/firebase/action.yml +++ b/.github/actions/firebase/action.yml @@ -13,7 +13,13 @@ runs: using: "composite" steps: # Copy files + - name: Copy build files to working directory level + if: ${{ inputs.package-name != '' }} + shell: bash + run: | + cp -r ${{ inputs.package-name }}/.output . + - name: Copy build/deployment files shell: bash run: | - cp ${{ github.action_path }}/files/* ${{ inputs.working-directory }}/${{ inputs.package-name }} + cp ${{ github.action_path }}/files/* ${{ inputs.working-directory }} diff --git a/.github/workflows/ui-cd-pnpm.yaml b/.github/workflows/ui-cd-pnpm.yaml index cbd35405..6e1ffc8f 100644 --- a/.github/workflows/ui-cd-pnpm.yaml +++ b/.github/workflows/ui-cd-pnpm.yaml @@ -108,6 +108,7 @@ jobs: # Build and push image to Google Container Registry - name: Build + if: ${{ inputs.package_name != '' }} working-directory: ${{ inputs.working_directory }} run: |- firebase="$(jq '.hosting.site="${{ env.FIREBASE_HOST_NAME }}"' firebase-${{ env.ENVIRONMENT }}.json)" @@ -116,6 +117,16 @@ jobs: --substitutions _DEPLOYMENT_ENVIRONMENT=${{ env.ENVIRONMENT }},_DEPLOYMENT_NODE_VERSION=${{ env.NODE_VERSION }},_DEPLOYMENT_PROJECT=${{ env.GCP_PROJECT }},_DEPLOYMENT_HOST_NAME=${{ env.FIREBASE_HOST_NAME }},_DEPLOYMENT_PCKG_NAME=${{ inputs.package_name }} \ --config cloudbuild-pnpm-cd.yaml + - name: Build + if: ${{ inputs.package_name == '' }} + working-directory: ${{ inputs.working_directory }} + run: |- + firebase="$(jq '.hosting.site="${{ env.FIREBASE_HOST_NAME }}"' firebase-${{ env.ENVIRONMENT }}.json)" + echo -E "${firebase}" > firebase-${{ env.ENVIRONMENT }}.json + gcloud builds submit \ + --substitutions _DEPLOYMENT_ENVIRONMENT=${{ env.ENVIRONMENT }},_DEPLOYMENT_NODE_VERSION=${{ env.NODE_VERSION }},_DEPLOYMENT_PROJECT=${{ env.GCP_PROJECT }},_DEPLOYMENT_HOST_NAME=${{ env.FIREBASE_HOST_NAME }} \ + --config cloudbuild-pnpm-cd.yaml + # Add git tag - name: Add git tag uses: bcgov/bcregistry-sre/.github/actions/add-git-tag@main