Facility Fix (#1282) #43
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: Project Factory Service Test Builder | |
on: | |
push: | |
branches: | |
- "console" | |
- "master" | |
paths: | |
- 'health-services/project-factory/**' | |
pull_request: | |
branches: | |
- "console" | |
- "master" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Fetch all history for tags and branches | |
# Step 2: Set up environment variables | |
- name: Set up environment variables | |
id: env | |
run: | | |
echo "ACTION_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV | |
# Step 3: Build the service Docker image | |
- name: Build the service Docker image | |
id: docker_build | |
working-directory: ./health-services/project-factory | |
run: | | |
IMAGE_TAG=egovio/project-factory:${{ env.ACTION_NUMBER }} | |
docker build . \ | |
--file Dockerfile \ | |
--tag $IMAGE_TAG | |
echo "::set-output name=image_name::$IMAGE_TAG" | |
echo "Service Docker image built successfully" | |
# Step 4: Build the database migration Docker image | |
- name: Build the DB migration Docker image | |
id: docker_db_build | |
working-directory: ./health-services/project-factory/migration | |
run: | | |
IMAGE_TAG=egovio/project-factory-db:${{ env.ACTION_NUMBER }} | |
docker build . \ | |
--file Dockerfile \ | |
--tag $IMAGE_TAG | |
echo "::set-output name=db_image_name::$IMAGE_TAG" | |
echo "DB migration Docker image built successfully" | |
node_build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- uses: actions/checkout@v3 | |
# Step 2: Set up Node.js environment | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
# Step 3: Install dependencies and build for production | |
- name: Install dependencies and build | |
working-directory: ./health-services/project-factory | |
run: | | |
yarn install | |
yarn build |