Skip to content

Commit

Permalink
Merge pull request #64 from kialj876/18160-pnpm-deployment-fix-7
Browse files Browse the repository at this point in the history
cleanup pnpm flow
  • Loading branch information
kialj876 authored Oct 20, 2023
2 parents 520ac24 + b6e2298 commit e030786
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
12 changes: 1 addition & 11 deletions .github/actions/firebase/files/cloudbuild-pnpm-cd.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
steps:
# install / Generate the static site
- name: node:$_DEPLOYMENT_NODE_VERSION (normal)
if: ${{ substitutions._DEPLOYMENT_PCKG_NAME == '' }}
- name: node:$_DEPLOYMENT_NODE_VERSION
script: |
#!/usr/bin/env bash
npm install --global pnpm
pnpm install
pnpm build
- name: node:$_DEPLOYMENT_NODE_VERSION (specific pckg)
if: ${{ substitutions._DEPLOYMENT_PCKG_NAME != '' }}
script: |
#!/usr/bin/env bash
npm install --global pnpm
pnpm -F $_DEPLOYMENT_PCKG_NAME install
pnpm -F $_DEPLOYMENT_PCKG_NAME build
#
# Deploy to firebase channel, using the PR #
# store log to /workspace to get the channel URL
Expand All @@ -29,7 +20,6 @@ substitutions:
_DEPLOYMENT_PROJECT: '${_DEPLOYMENT_PROJECT}'
_DEPLOYMENT_NODE_VERSION: '${_DEPLOYMENT_NODE_VERSION}'
_DEPLOYMENT_HOST_NAME: '${_DEPLOYMENT_HOST_NAME}'
_DEPLOYMENT_PCKG_NAME: '${_DEPLOYMENT_PCKG_NAME}'


options:
Expand Down
27 changes: 27 additions & 0 deletions .github/actions/firebase/files/cloudbuild-pnpm-nested-pckg-cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
steps:
# install / Generate the static site
- name: node:$_DEPLOYMENT_NODE_VERSION
script: |
#!/usr/bin/env bash
npm install --global pnpm
pnpm -F $_DEPLOYMENT_PCKG_NAME install
pnpm -F $_DEPLOYMENT_PCKG_NAME build
#
# Deploy to firebase channel, using the PR #
# store log to /workspace to get the channel URL
#
- name: gcr.io/$_DEPLOYMENT_PROJECT/firebase
entrypoint: bash
args: ['-c', 'firebase deploy --project=$_DEPLOYMENT_PROJECT --config=firebase-$_DEPLOYMENT_ENVIRONMENT.json --only hosting:$_DEPLOYMENT_HOST_NAME']

substitutions:
_DEPLOYMENT_ENVIRONMENT: '${_DEPLOYMENT_ENVIRONMENT}'
_DEPLOYMENT_PROJECT: '${_DEPLOYMENT_PROJECT}'
_DEPLOYMENT_NODE_VERSION: '${_DEPLOYMENT_NODE_VERSION}'
_DEPLOYMENT_HOST_NAME: '${_DEPLOYMENT_HOST_NAME}'
_DEPLOYMENT_PCKG_NAME: '${_DEPLOYMENT_PCKG_NAME}'


options:
logging: CLOUD_LOGGING_ONLY
2 changes: 1 addition & 1 deletion .github/workflows/ui-cd-pnpm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
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 }},_DEPLOYMENT_PCKG_NAME=${{ inputs.package_name }} \
--config cloudbuild-pnpm-cd.yaml
--config cloudbuild-pnpm-nested-pckg-cd.yaml
- name: Build (normal)
if: ${{ inputs.package_name == '' }}
Expand Down

0 comments on commit e030786

Please sign in to comment.