WIP - Create Candid encounter during "Sign appointment" #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Intake | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main, develop] | |
paths: | |
- 'apps/intake/**' | |
- 'packages/intake/**' | |
- 'packages/utils/**' | |
- 'packages/ui-components/**' | |
- 'scripts/build-intake.sh' | |
- '.github/**' | |
- '.prettierignore' | |
- 'package.json' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- 'apps/intake/**' | |
- 'packages/intake/**' | |
- 'packages/utils/**' | |
- 'packages/ui-components/**' | |
- 'scripts/build-build-intake.sh' | |
- '.github/**' | |
- '.prettierignore' | |
- 'package.json' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest-8-cores | |
timeout-minutes: 15 | |
steps: | |
- name: Install SSH Client | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.DEPLOY_OTTEHR_KEY }} | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Check out secrets repo to grab the secrets file. | |
uses: actions/checkout@v3 | |
with: | |
repository: masslight/ottehr-secrets | |
ssh-key: ${{ secrets.DEPLOY_OTTEHR_KEY }} | |
path: 'secrets' | |
- name: Move secret file into the urgent care packages/intake/zambdas directory. | |
run: mkdir -p packages/intake/zambdas/.env; cp secrets/zambdas/* packages/intake/zambdas/.env | |
- name: Move app secrets file into intake app dir. | |
run: cp secrets/intake/app/.env.local apps/intake/env/ | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Run build-intake.sh | |
env: | |
NODE_OPTIONS: '--max-old-space-size=8192' | |
run: ./scripts/build-intake.sh | |
- name: Report status - Success | |
if: ${{ always() }} | |
run: echo "::set-output name=build_status::success" | |
- name: Report status - Failure | |
if: ${{ failure() }} | |
run: echo "::set-output name=build_status::failure" | |
- name: Set status | |
if: ${{ env.build_status != '' }} | |
run: | | |
if [[ "${{ env.build_status }}" == "success" ]]; then | |
echo "Build successful - setting status" | |
gh pr status "$GITHUB_SHA" -s success -d "Build successful" | |
else | |
echo "Build failed - setting status" | |
gh pr status "$GITHUB_SHA" -s failure -d "Build failed" | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |