Skip to content

Samir/pin ga sha

Samir/pin ga sha #818

Workflow file for this run

name: Build Ottehr
on:
workflow_dispatch:
push:
branches: [main]
paths:
- packages/*
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: ubuntu-latest
environment: dev
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '18'
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Create secrets file from github secrets
id: create-json
uses: jsdaniell/create-json@b8e77fa01397ca39cc4a6198cc29a3be5481afef # v1.2.3
with:
name: 'secrets.json'
json: ${{ secrets.OTTEHR_SECRETS_JSON }}
- name: Set the telemed-ehr/zambdas/.env/development.json
run: cp packages/telemed-ehr/zambdas/.env/local.template.json packages/telemed-ehr/zambdas/.env/development.json
- name: Set the telemed-intake/zambdas/.env/development.json
run: cp packages/telemed-intake/zambdas/.env/local.template.json packages/telemed-intake/zambdas/.env/development.json
- name: Set the urgent-care-intake/zambdas/.env/development.json
run: cp packages/urgent-care-intake/zambdas/.env/local.template.json packages/urgent-care-intake/zambdas/.env/development.json
- id: get-store-path
run: echo STORE_PATH=$(pnpm store path) >> $GITHUB_OUTPUT
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
timeout-minutes: 5
id: cache-pnpm-store
with:
path: ${{ steps.get-store-path.outputs.STORE_PATH }}
key: pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-
pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
- name: Run build.sh
env:
NODE_OPTIONS: '--max-old-space-size=8192'
run: ./scripts/build.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 }}