Skip to content

Commit

Permalink
Fix errors in deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarZubaidi committed Oct 10, 2023
1 parent 0513aa8 commit 60a11a8
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
env:
PACKAGE_LOCATION: packages/app
ZAMBDAS_LOCATION: packages/zambdas
SLACK_NOTIFICATION_SERVICE_NAME: bh-intake-ui
SLACK_NOTIFICATION_SERVICE_NAME: zapehr-telehealth

runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
Expand All @@ -53,6 +53,7 @@ jobs:
with:
ssh-private-key: |
${{ secrets.ZAPEHR_TELEHEALTH_PRIVATE_SSH_KEY }}
${{ secrets.BUMP_VERSION }}
- name: If environment is production, ensure keys are coming in through input parameters.
if: ${{ github.event.inputs.environment == 'production' && !(github.event.inputs.confirmProduction == 'Yes') }}
Expand All @@ -76,7 +77,7 @@ jobs:
json: ${{ secrets.TELEHEALTH_SECRETS_JSON }}

- name: Move env file into .env folder
run: mkdir -p ${{ env.ZAMBDAS_LOCATION }}/.env/ && cp secrets.json ${{ env.ZAMBDAS_LOCATION }}/.env/${{ secrets.ENVIRONMENT }}.json
run: mkdir -p ${{ env.ZAMBDAS_LOCATION }}/.env/ && mv secrets.json ${{ env.ZAMBDAS_LOCATION }}/.env/${{ secrets.ENVIRONMENT }}.json

- name: Increase version if input dictates.
if: ${{ github.event.inputs.incrementVersion == 'true' }}
Expand All @@ -95,20 +96,18 @@ jobs:
- name: Get Version Number from package.json for build notifications.
id: package-version
uses: martinbeentjes/[email protected]
with:
path: ${{ env.PACKAGE_LOCATION }}

- name: Install dependencies
run: pnpm ci

## todo
- name: Deploy app
run: cd ${{ env.PACKAGE_LOCATION }} && pnpm run ci-deploy:${{ env.ENVIRONMENT }}
## todo
run: cd ${{ env.PACKAGE_LOCATION }} && pnpm run ci-deploy:${{ github.event.inputs.environment }}
- name: Setup zapehr secrets
run: cd ${{ env.ZAMBDAS_LOCATION }} && pnpm run setup-zapehr-secrets ${{ env.ENVIRONMENT }}
## todo
run: cd ${{ env.ZAMBDAS_LOCATION }} && pnpm run setup-zapehr-secrets ${{ github.event.inputs.environment }}
- name: Deploy zambdas
run: cd ${{ env.ZAMBDAS_LOCATION }} && pnpm run deploy-zambdas ${{ env.ENVIRONMENT }}
run: cd ${{ env.ZAMBDAS_LOCATION }} && pnpm run deploy-zambdas ${{ github.event.inputs.environment }}

- name: Notify Slack
if: always()
Expand All @@ -118,11 +117,11 @@ jobs:
BRANCH: ${{ github.ref }}
PACKAGE_VERSION: ${{ steps.package-version.outputs.current-version }}
with:
channel: '#pm-pediatrics-notifications'
channel: '#zapehr-notifications'
status: ${{ job.status }}
success_text: '${env.GITHUB_WORKFLOW} (${env.GITHUB_RUN_NUMBER}) build completed successfully'
failure_text: '${env.GITHUB_WORKFLOW} (${env.GITHUB_RUN_NUMBER}) build failed'
cancelled_text: '${env.GITHUB_WORKFLOW} (${env.GITHUB_RUN_NUMBER}) build was cancelled'
success_text: '${env.GITHUB_WORKFLOW} (${env.GITHUB_RUN_NUMBER}) deploy completed successfully'
failure_text: '${env.GITHUB_WORKFLOW} (${env.GITHUB_RUN_NUMBER}) deploy failed'
cancelled_text: '${env.GITHUB_WORKFLOW} (${env.GITHUB_RUN_NUMBER}) deploy was cancelled'
fields: |
[{ "title": "Service", "value": "${env.SLACK_NOTIFICATION_SERVICE_NAME}", "short": true },
{ "title": "Action URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}"},
Expand Down

0 comments on commit 60a11a8

Please sign in to comment.