diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index beaf7ba9..1ba413c5 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -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 }} @@ -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') }} @@ -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' }} @@ -95,20 +96,18 @@ jobs: - name: Get Version Number from package.json for build notifications. id: package-version uses: martinbeentjes/npm-get-version-action@v1.3.1 + 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() @@ -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}"},