Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
e095c3f
npx sv create
FyreByrd Sep 4, 2025
de28f9f
Copy styling from Scriptoria
FyreByrd Sep 4, 2025
fcb72ae
Check in .vscode/settings.json
FyreByrd Sep 4, 2025
90c6b71
Basic structure
FyreByrd Sep 4, 2025
5fb2840
npx prisma db pull
FyreByrd Sep 5, 2025
dbddea5
MySQL docker compose
FyreByrd Sep 5, 2025
6c66cee
Update db version
FyreByrd Sep 5, 2025
c643df2
Add image for ssh tunneling to staging server
FyreByrd Sep 8, 2025
a109081
Add some components from S2
FyreByrd Sep 8, 2025
5ba6549
Populate clients page
FyreByrd Sep 8, 2025
e881df4
Remove Operations Queue from frontend
FyreByrd Sep 9, 2025
9b77cc5
Remove contact page
FyreByrd Sep 9, 2025
c81c7eb
Update site information and logo
FyreByrd Sep 9, 2025
e76ecf4
Paginate clients
FyreByrd Sep 9, 2025
b5b2331
autofill created/updated fields
FyreByrd Sep 9, 2025
16f4082
Host dev on 8443
FyreByrd Sep 23, 2025
68e94ed
Fix lint
FyreByrd Sep 23, 2025
26096fb
Dynamic title
FyreByrd Sep 23, 2025
5a0560a
Add Iconify
FyreByrd Sep 23, 2025
be2597b
Client view page
FyreByrd Sep 23, 2025
2f26bb5
Client create page
FyreByrd Sep 23, 2025
7f37d6e
Fix id routing
FyreByrd Sep 23, 2025
aea940f
Client Update
FyreByrd Sep 23, 2025
a41cd11
Client delete
FyreByrd Sep 23, 2025
109c770
Sort clients
FyreByrd Sep 23, 2025
14d14c8
Fix layout for x overflow
FyreByrd Sep 23, 2025
d9f6d72
Remove client from list when deleted
FyreByrd Sep 23, 2025
e68d604
Fix lint issues
FyreByrd Sep 23, 2025
487f66c
Add function to validate '' to null
FyreByrd Sep 23, 2025
922fec5
Give form fields full width
FyreByrd Sep 23, 2025
9deaf5f
Add list, view, update for Jobs
FyreByrd Sep 23, 2025
c8c95c9
OrderBy descending
FyreByrd Sep 24, 2025
6006ceb
Handle FK errors in job update
FyreByrd Sep 24, 2025
075c4eb
Sort by all fields
FyreByrd Sep 24, 2025
9968752
Use v.strictObject, select using schema
FyreByrd Sep 24, 2025
494aede
Fix job-admin formatting
FyreByrd Sep 24, 2025
ff93a69
Add minimal functionality from application/common/Build.php
FyreByrd Sep 24, 2025
743da2b
Add list, view, update for Builds
FyreByrd Sep 24, 2025
dee1737
Fix initial sort direction
FyreByrd Sep 24, 2025
36c27a7
Fix some things in build-admin
FyreByrd Sep 24, 2025
7a8cced
Add list, view, update for Releases
FyreByrd Sep 24, 2025
adfa494
Add list, view, update for Projects
FyreByrd Sep 24, 2025
74b2ee0
Add authorization hook
FyreByrd Sep 25, 2025
204a801
GET system/check
FyreByrd Sep 25, 2025
b106c88
npm i @types/node
FyreByrd Sep 29, 2025
22eb41e
Add ErrorResponse utility function
FyreByrd Sep 29, 2025
5959bea
Populate locals.clientId
FyreByrd Sep 29, 2025
708ef5a
POST /project (create new project)
FyreByrd Sep 29, 2025
514765b
Stub out rest of /project routes
FyreByrd Sep 30, 2025
bfe9c3a
Add stubs for remaining functions
FyreByrd Sep 30, 2025
5fb5d24
Add idNumber route param filter
FyreByrd Sep 30, 2025
a98b22e
Create/fetch job
FyreByrd Sep 30, 2025
117efe7
Add Allow header to deprecated endpoints
FyreByrd Sep 30, 2025
271aa72
Delete job
FyreByrd Sep 30, 2025
c4b129b
Create/fetch build
FyreByrd Sep 30, 2025
bd44b84
Remove unneeded console logs
FyreByrd Sep 30, 2025
5d8d59a
Create/fetch release
FyreByrd Sep 30, 2025
dfca479
Get project access token
FyreByrd Oct 9, 2025
3b0bc2c
Remove unneeded comments copied from PHP
FyreByrd Oct 10, 2025
92a4287
More AWS deps
FyreByrd Oct 14, 2025
84d5fc1
CodeCommit wrapper
FyreByrd Oct 14, 2025
c936358
Utils.getPrefix()
FyreByrd Oct 15, 2025
0e4332c
Install IAM client package
FyreByrd Oct 16, 2025
1679d9f
Use $env/dynamic/private in AWSCommon
FyreByrd Oct 16, 2025
d449e93
Add yml versions of build scripts
FyreByrd Oct 16, 2025
0030c4f
Add minimal stubs for relevant models
FyreByrd Oct 16, 2025
7729810
Partial translation of remaining AWS wrappers
FyreByrd Oct 16, 2025
d498d75
Partial translations of jobs/actions
FyreByrd Oct 16, 2025
19a5db1
Add valkey image to docker-compose
FyreByrd Oct 22, 2025
ed0e7fe
Install BullMQ
FyreByrd Oct 22, 2025
fdea01c
Add basics for BullMQ
FyreByrd Oct 22, 2025
8da59c7
Add stubs for BullMQ jobs
FyreByrd Oct 22, 2025
9cd418c
BullMQ jobs for save/error to S3
FyreByrd Oct 22, 2025
c682d3a
Relocate models and artifacts
FyreByrd Oct 23, 2025
6939a49
Fix missing function in CodeBuild
FyreByrd Oct 23, 2025
204509f
Move artifacts functions to individual models
FyreByrd Oct 23, 2025
797311b
Fix lint errors
FyreByrd Oct 23, 2025
a745de9
Build task
FyreByrd Oct 23, 2025
172a15d
Add queue prefix so BuildEngine can share valkey
FyreByrd Oct 23, 2025
b61078a
Fix find-and-replace in STS
FyreByrd Oct 29, 2025
5a1717a
Fix project creation
FyreByrd Oct 29, 2025
d9213d6
Add Build to queue
FyreByrd Oct 29, 2025
d667e38
Write error to DB from try/catch
FyreByrd Oct 29, 2025
2492331
Read scripts from correct location
FyreByrd Oct 29, 2025
6dbe7b2
Use PostgreSQL instead of MariaDB
FyreByrd Oct 29, 2025
b847ebe
Create system startup job to create CodeBuild project
FyreByrd Oct 29, 2025
307ba76
Add missing migration
FyreByrd Oct 29, 2025
b14670d
Fix Builds artifact view
FyreByrd Nov 12, 2025
9cf04ae
Fix build polling
FyreByrd Nov 12, 2025
970f93b
Small fixes in S3 wrapper
FyreByrd Nov 12, 2025
0d13035
Use Scriptoria for Authentication (#72)
FyreByrd Feb 2, 2026
a61708f
Allow job update
FyreByrd Feb 2, 2026
52b2341
Add content-type header for token exchange
FyreByrd Feb 2, 2026
6b6323a
Add jobs for product release
FyreByrd Feb 2, 2026
3439e49
Finish translating project action
FyreByrd Feb 2, 2026
1ffb42c
Write APPBUILDER_SCRIPT_VERSION to version.json (#63)
FyreByrd Oct 21, 2025
6b1640c
Fix usage of UI_URL/ORIGIN
chrisvire Oct 22, 2025
0f4c39c
Download Play Listing (#71)
chrisvire Oct 28, 2025
b0790ab
Make sure metadata folder is empty
chrisvire Nov 9, 2025
2d5bdf5
Update /system/check to return app versions
chrisvire Nov 11, 2025
71b96ba
Remove conditional around data-safety-csv (old)
chrisvire Nov 12, 2025
2d41474
Conditionally build AAB+APK vs separate APK and AAB
chrisvire Nov 12, 2025
56a00ea
Allow pwa-sub-directory to be located anywhere in app-defintion
chrisvire Dec 10, 2025
88400e5
Add SCRIPTURE_EARTH_DESCRIPTION
chrisvire Dec 10, 2025
783208e
SAB 13.4 PWA output directory changed
chrisvire Feb 3, 2026
bcd20cd
Fix DB startup error
FyreByrd Feb 3, 2026
6c4e117
Fix build errors
FyreByrd Feb 5, 2026
a6f565f
Change build output folder
FyreByrd Feb 5, 2026
f538f49
Add fixSourcemaps script
FyreByrd Feb 5, 2026
80dd7ef
Docker build
FyreByrd Feb 5, 2026
e1530cd
Support default api key
FyreByrd Feb 16, 2026
526bc08
Fix await sequencing
FyreByrd Feb 17, 2026
d30e9dc
Fix incorrect getArtifactsPath call
FyreByrd Feb 17, 2026
dd953f4
Remove unnecessary if statement
FyreByrd Feb 17, 2026
c10da47
Apparently extname includes the dot...
FyreByrd Feb 17, 2026
84c5ae2
Fix remaining await sequencing
FyreByrd Feb 17, 2026
87711b8
Forgot to add job to poll release...
FyreByrd Feb 17, 2026
4748101
Remove recurring job
FyreByrd Feb 17, 2026
8977896
Cache AppVersion in Database (#73)
FyreByrd Feb 25, 2026
5f229a0
Enforce string length (#76)
FyreByrd Feb 25, 2026
8afc8d8
Add OTEL instrumentation (#74)
FyreByrd Feb 25, 2026
8378fc4
Various fixes
FyreByrd Feb 25, 2026
39e8f6e
Cancel build/release on delete
FyreByrd Feb 25, 2026
a57c289
Add comments for #77
FyreByrd Feb 26, 2026
309fb3a
Remove unneeded action
FyreByrd Feb 26, 2026
a551615
Remove unneeded create project job
FyreByrd Feb 26, 2026
acf29e3
Clean up AWS code
FyreByrd Feb 26, 2026
8982ac0
Remove CodeCommit
FyreByrd Feb 26, 2026
51793c1
Fix run.sh
FyreByrd Feb 27, 2026
1847e35
Remove old code
FyreByrd Feb 27, 2026
2d32bc5
Fix prisma config warning
FyreByrd Feb 27, 2026
84569ef
Update example env
FyreByrd Feb 27, 2026
e2c58ff
Add ci docker compose
FyreByrd Feb 27, 2026
4ed2269
Add CI to run script
FyreByrd Feb 27, 2026
fae9fd6
Initial draft of GHA (#78)
FyreByrd Mar 26, 2026
4d55edc
Address Devin feedback on GHA
FyreByrd Mar 27, 2026
7cb620d
Fix typos
FyreByrd Mar 27, 2026
329cb38
Fix CodeBuild scripts upload
FyreByrd Mar 27, 2026
6c87117
Fix env typo in GHA
FyreByrd Mar 27, 2026
48b2690
Fix delete build with releases
FyreByrd Mar 27, 2026
23950dc
Fix URL construction for redirect
FyreByrd Mar 27, 2026
41b5bf8
Fix missing workers
FyreByrd Mar 27, 2026
49c243b
Resolve timing safety with access token fallback
FyreByrd Mar 27, 2026
7d2fff3
Resolve Devin feedback
FyreByrd Mar 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
.git
phpinfo.php
local.env
Vagrantfile
96 changes: 96 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: BuildEngine v2 Deploy to AWS

on:
workflow_call:
inputs:
BUILD_NUMBER:
type: 'string'
required: true
ECS_CLUSTER:
type: 'string'
required: true
DOCKER_TAG:
type: 'string'
required: true
BUILD_ENGINE_TAG:
type: 'string'
required: true
OTEL_TAG:
type: 'string'
required: true
secrets:
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
AWS_DEFAULT_REGION:
required: true
AWS_ECR_ACCOUNT:
required: true

jobs:
deploy-to-ecr:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
echo "Installing ecs-deploy script..."
mkdir -p $HOME/.local/bin
curl -o $HOME/.local/bin/ecs-deploy https://raw.githubusercontent.com/silinternational/ecs-deploy/master/ecs-deploy
chmod +x $HOME/.local/bin/ecs-deploy

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull from GHCR
run: |
docker pull ghcr.io/${{ inputs.BUILD_ENGINE_TAG }}
docker pull ghcr.io/${{ inputs.OTEL_TAG }}

- name: Configure AWS credentials
id: aws
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}

- name: Login to AWS ECR
id: ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registries: ${{ secrets.AWS_ECR_ACCOUNT }}

- name: Build deployment target variables
id: vars
run: |
echo "Setting up deployment variables..."
echo "IMAGE_URL=${{ steps.ecr.outputs.registry }}/appbuilder-buildengine-api" >> $GITHUB_OUTPUT
echo "OTEL_URL=${{ steps.ecr.outputs.registry }}/appbuilder-buildengine-otel" >> $GITHUB_OUTPUT

- name: Push to AWS ECR
run: |
docker tag ${{ inputs.BUILD_ENGINE_TAG}} "${{ steps.vars.outputs.IMAGE_URL }}:${{ inputs.DOCKER_TAG }}"
docker tag ${{ inputs.BUILD_ENGINE_TAG}} "${{ steps.vars.outputs.IMAGE_URL }}:${{ inputs.BUILD_NUMBER }}"
docker tag ${{ inputs.OTEL_TAG}} "${{ steps.vars.outputs.OTEL_URL }}:${{ inputs.DOCKER_TAG }}"
docker tag ${{ inputs.OTEL_TAG}} "${{ steps.vars.outputs.OTEL_URL }}:${{ inputs.BUILD_NUMBER }}"
echo "Docker images tagged as ${{ inputs.DOCKER_TAG }} and ${{ inputs.BUILD_NUMBER }}"

docker push "${{ steps.vars.outputs.IMAGE_URL }}:${{ inputs.DOCKER_TAG }}"
docker push "${{ steps.vars.outputs.IMAGE_URL }}:${{ inputs.BUILD_NUMBER }}"
echo "Docker images pushed successfully to ${{ steps.vars.outputs.IMAGE_URL }}"

docker push "${{ steps.vars.outputs.OTEL_URL }}:${{ inputs.DOCKER_TAG }}"
docker push "${{ steps.vars.outputs.OTEL_URL }}:${{ inputs.BUILD_NUMBER }}"
echo "Docker images pushed successfully to ${{ steps.vars.outputs.OTEL_URL }}"

- name: Deploy to ECS
if: ${{ inputs.ECS_CLUSTER != 'none' }}
run: |
echo "Deploying ${{ inputs.BUILD_NUMBER }} to ${{ inputs.ECS_CLUSTER }}"
# Deploy to ECS cluster with service name 'build-engine', setting all images to the latest tag
ecs-deploy -c ${{ inputs.ECS_CLUSTER }} -n buildengine -i ignore -to ${{ inputs.BUILD_NUMBER }} --max-definitions 20 --timeout 600
245 changes: 91 additions & 154 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,58 @@
name: BuildEngine CI
name: BuildEngine v2 Test and Deploy

on:
push:
branches: [master, develop, github-builds]
pull_request:
branches:
- master
- develop
workflow_dispatch:
inputs:
logLevel:
description: "Log Level"
required: true
default: "warning"
tags:
description: "Tags"
schedule:
- cron: "0 0 * * 0" # weekly

env:
BUILD_TAG: "build-engine-api:${{ github.run_number }}"
BUILD_NUMBER: ${{ github.run_number }}

jobs:
build:
check:
uses: "./.github/workflows/setup.yml"
secrets:
AUTH0_SECRET: ${{ secrets.AUTH0_SECRET }}
push-to-ghcr:
runs-on: ubuntu-latest

needs: check
outputs:
DOCKER_TAG: ${{ steps.branch.outputs.DOCKER_TAG }}
ECS_CLUSTER: ${{ steps.branch.outputs.ECS_CLUSTER }}
BUILD_ENGINE_TAG: ${{ steps.push.outputs.BUILD_ENGINE_TAG }}
OTEL_TAG: ${{ steps.push.outputs.OTEL_TAG }}
if: ${{ success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') }}
steps:
- uses: actions/checkout@v3

- name: Get environment info
run: |
echo Docker version
docker --version
echo
echo Env
env

- name: Setup local.env
run: |
echo "COMPOSER_AUTH={\"github-oauth\":{\"github.com\":\""${{ secrets.GITHUB_TOKEN }}\""}}" > local.env

- name: Install dependencies
run: |
echo "Installing ecs-deploy script..."
mkdir -p $HOME/.local/bin
curl -o $HOME/.local/bin/ecs-deploy https://raw.githubusercontent.com/silinternational/ecs-deploy/master/ecs-deploy
chmod +x $HOME/.local/bin/ecs-deploy

- name: Tests
run: |
make test
- name: Checkout
uses: actions/checkout@v5

- name: Build docker image
uses: docker/build-push-action@v4
- name: Setup node
uses: actions/setup-node@v5
with:
push: false
tags: ${{ env.BUILD_TAG }}
context: .
load: true
node-version: 24

- name: Determine branch tag
id: branch
run: |
if [[ "${GITHUB_HEAD_REF}" != "" ]]; then BRANCH="${GITHUB_HEAD_REF}"; else BRANCH="${GITHUB_REF_NAME}"; fi
case $BRANCH in develop) DOCKER_TAG="staging" ;; master) DOCKER_TAG="production" ;; *) DOCKER_TAG="${BRANCH//\//-}" ;; esac
case $BRANCH in develop) ECS_CLUSTER="scriptoria-stg";; master) ECS_CLUSTER="scriptoria-prd" ;; *) ECS_CLUSTER="none" ;; esac
echo "DockerTag=${DOCKER_TAG}" >> $GITHUB_OUTPUT
echo "EcsCluster=${ECS_CLUSTER}" >> $GITHUB_OUTPUT
echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_OUTPUT
echo "ECS_CLUSTER=${ECS_CLUSTER}" >> $GITHUB_OUTPUT

- name: Build Docker images
id: build
run: |
BUILD_ENGINE_BUILD_TAG="build-engine-api:${{ github.run_number }}"
OTEL_BUILD_TAG="build-engine-otel:${{ github.run_number }}"
echo "Building Docker images..."
docker build -t $BUILD_ENGINE_BUILD_TAG .
docker build -t $OTEL_BUILD_TAG -f Dockerfile.otel .
echo "Docker images built successfully."
echo "BUILD_ENGINE_BUILD_TAG=${BUILD_ENGINE_BUILD_TAG}" >> $GITHUB_OUTPUT
echo "OTEL_BUILD_TAG=${OTEL_BUILD_TAG}" >> $GITHUB_OUTPUT

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -74,111 +62,60 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push to GHCR
id: push
run: |
docker tag ${{ env.BUILD_TAG }} ghcr.io/sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}
docker push ghcr.io/sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}

- name: Configure AWS credentials (SIL)
id: aws_sil
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.SIL__AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SIL__AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.SIL__AWS_DEFAULT_REGION }}

- name: Login to AWS ECR (SIL)
id: ecr_sil
uses: aws-actions/amazon-ecr-login@v2
with:
registries: ${{ secrets.SIL__AWS_ECR_ACCOUNT }}

- name: Push to AWS ECR (SIL)
run: |
docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}"
docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}"
docker push "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}"
docker push "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}"

- name: Deploy to ECS (SIL)
if: ${{ steps.branch.outputs.EcsCluster != 'none' }}
run: |
echo "Deploying ${{ env.BUILD_NUMBER }} to ${{ steps.branch.outputs.EcsCluster }}"
# Deploy to ECS cluster with service name 'build-engine', setting all images to the latest tag
ecs-deploy -c ${{ steps.branch.outputs.EcsCluster }} -n buildengine -i ignore -to ${{ env.BUILD_NUMBER }} --max-definitions 20 --timeout 600
echo "Deployment initiated successfully."

- name: Configure AWS credentials (FCBH)
if: false # Temporarily disabled - remove this line to re-enable
# if: ${{ steps.branch.outputs.EcsCluster == 'scriptoria-prd' }} # Restore this when re-enabling
id: aws_fcbh
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.FCBH__AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.FCBH__AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.FCBH__AWS_DEFAULT_REGION }}

- name: Login to AWS ECR (FCBH)
if: false # Temporarily disabled - remove this line to re-enable
# if: ${{ steps.branch.outputs.EcsCluster == 'scriptoria-prd' }} # Restore this when re-enabling
id: ecr_fcbh
uses: aws-actions/amazon-ecr-login@v2
with:
registries: ${{ secrets.FCBH__AWS_ECR_ACCOUNT }}

- name: Push to AWS ECR (FCBH)
if: false # Temporarily disabled - remove this line to re-enable
# if: ${{ steps.branch.outputs.EcsCluster == 'scriptoria-prd' }} # Restore this when re-enabling
run: |
docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}"
docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}"
docker push "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}"
docker push "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}"

- name: Deploy to ECS (FCBH)
if: false # Temporarily disabled - remove this line to re-enable
# if: ${{ steps.branch.outputs.EcsCluster == 'scriptoria-prd' }} # Restore this when re-enabling
run: |
echo "Deploying ${{ env.BUILD_NUMBER }} to ${{ steps.branch.outputs.EcsCluster }}"
# Deploy to ECS cluster with service name 'build-engine', setting all images to the latest tag
ecs-deploy -c ${{ steps.branch.outputs.EcsCluster }} -n buildengine -i ignore -to ${{ env.BUILD_NUMBER }} --max-definitions 20 --timeout 600
echo "Deployment initiated successfully."

- name: Configure AWS credentials (LU)
if: ${{ steps.branch.outputs.EcsCluster == 'scriptoria-stg' }}
id: aws_lu
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.LU__AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.LU__AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.LU__AWS_DEFAULT_REGION }}

- name: Login to AWS ECR (LU)
if: ${{ steps.branch.outputs.EcsCluster == 'scriptoria-stg' }}
id: ecr_lu
uses: aws-actions/amazon-ecr-login@v2
with:
registries: ${{ secrets.LU__AWS_ECR_ACCOUNT }}

- name: Push to AWS ECR (LU)
if: ${{ steps.branch.outputs.EcsCluster == 'scriptoria-stg' }}
run: |
docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}"
docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}"
docker push "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}"
docker push "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}"

- name: Deploy to ECS (LU)
if: ${{ steps.branch.outputs.EcsCluster == 'scriptoria-stg' }}
run: |
echo "Deploying ${{ env.BUILD_NUMBER }} to ${{ steps.branch.outputs.EcsCluster }}"
# Deploy to ECS cluster with service name 'build-engine', setting all images to the latest tag
ecs-deploy -c ${{ steps.branch.outputs.EcsCluster }} -n buildengine -i ignore -to ${{ env.BUILD_NUMBER }} --max-definitions 20 --timeout 600
echo "Deployment initiated successfully."

- name: Clean up older packages
uses: actions/delete-package-versions@v4
with:
package-name: "appbuilder-buildengine-api"
package-type: "container"
min-versions-to-keep: 6
delete-only-untagged-versions: "true"
BUILD_ENGINE_TAG="sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DOCKER_TAG }}"
docker tag ${{ steps.build.outputs.BUILD_ENGINE_BUILD_TAG }} ghcr.io/${BUILD_ENGINE_TAG}
docker push ghcr.io/${BUILD_ENGINE_TAG}
echo "BUILD_ENGINE_TAG=${BUILD_ENGINE_TAG}" >> $GITHUB_OUTPUT

OTEL_TAG="sillsdev/appbuilder-buildengine-otel:${{ steps.branch.outputs.DOCKER_TAG }}"
docker tag ${{ steps.build.outputs.OTEL_BUILD_TAG }} ghcr.io/${OTEL_TAG}
docker push ghcr.io/${OTEL_TAG}
echo "OTEL_TAG=${OTEL_TAG}" >> $GITHUB_OUTPUT

deploy-sil:
needs: push-to-ghcr
uses: "./.github/workflows/deploy.yml"
with:
BUILD_NUMBER: ${{ github.run_number }}
ECS_CLUSTER: ${{ needs.push-to-ghcr.outputs.ECS_CLUSTER }}
DOCKER_TAG: ${{ needs.push-to-ghcr.outputs.DOCKER_TAG }}
BUILD_ENGINE_TAG: ${{ needs.push-to-ghcr.outputs.BUILD_ENGINE_TAG }}
OTEL_TAG: ${{ needs.push-to-ghcr.outputs.OTEL_TAG }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.SIL__AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SIL__AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.SIL__AWS_DEFAULT_REGION }}
AWS_ECR_ACCOUNT: ${{ secrets.SIL__AWS_ECR_ACCOUNT }}
deploy-fcbh:
needs: push-to-ghcr
if: false # Temporarily disabled - remove this line to re-enable
# if: ${{ needs.push-to-ghcr.outputs.ECS_CLUSTER == 'scriptoria-prd' }} # Restore this when re-enabling
uses: "./.github/workflows/deploy.yml"
with:
BUILD_NUMBER: ${{ github.run_number }}
ECS_CLUSTER: ${{ needs.push-to-ghcr.outputs.ECS_CLUSTER }}
DOCKER_TAG: ${{ needs.push-to-ghcr.outputs.DOCKER_TAG }}
BUILD_ENGINE_TAG: ${{ needs.push-to-ghcr.outputs.BUILD_ENGINE_TAG }}
OTEL_TAG: ${{ needs.push-to-ghcr.outputs.OTEL_TAG }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.FCBH__AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.FCBH__AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.FCBH__AWS_DEFAULT_REGION }}
AWS_ECR_ACCOUNT: ${{ secrets.FCBH__AWS_ECR_ACCOUNT }}
deploy-lu:
needs: push-to-ghcr
if: ${{ needs.push-to-ghcr.outputs.ECS_CLUSTER == 'scriptoria-stg' }}
uses: "./.github/workflows/deploy.yml"
with:
BUILD_NUMBER: ${{ github.run_number }}
ECS_CLUSTER: ${{ needs.push-to-ghcr.outputs.ECS_CLUSTER }}
DOCKER_TAG: ${{ needs.push-to-ghcr.outputs.DOCKER_TAG }}
BUILD_ENGINE_TAG: ${{ needs.push-to-ghcr.outputs.BUILD_ENGINE_TAG }}
OTEL_TAG: ${{ needs.push-to-ghcr.outputs.OTEL_TAG }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.LU__AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.LU__AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.LU__AWS_DEFAULT_REGION }}
AWS_ECR_ACCOUNT: ${{ secrets.LU__AWS_ECR_ACCOUNT }}
8 changes: 8 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Test and Lint

on:
pull_request:

jobs:
checks:
uses: ./.github/workflows/setup.yml
Loading
Loading