|
1 | | -name: BuildEngine CI |
| 1 | +name: BuildEngine v2 Test and Deploy |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [master, develop, github-builds] |
6 | | - pull_request: |
7 | 5 | workflow_dispatch: |
8 | 6 | inputs: |
9 | | - logLevel: |
10 | | - description: "Log Level" |
11 | | - required: true |
12 | | - default: "warning" |
13 | 7 | tags: |
14 | 8 | description: "Tags" |
15 | | - schedule: |
16 | | - - cron: "0 0 * * 0" # weekly |
17 | 9 |
|
18 | 10 | env: |
19 | | - BUILD_TAG: "build-engine-api:${{ github.run_number }}" |
| 11 | + BUILD_ENGINE_BUILD_TAG: "build-engine-api:${{ github.run_number }}" |
| 12 | + OTEL_BUILD_TAG: "scriptoria-otel:${{ github.run_number }}" |
20 | 13 | BUILD_NUMBER: ${{ github.run_number }} |
21 | 14 |
|
22 | 15 | jobs: |
23 | | - build: |
| 16 | + check: |
| 17 | + uses: "./.github/workflows/setup.yml" |
| 18 | + secrets: |
| 19 | + AUTH0_SECRET: ${{ secrets.AUTH0_SECRET }} |
| 20 | + deploy-to-ecr: |
24 | 21 | runs-on: ubuntu-latest |
25 | | - |
| 22 | + needs: check |
| 23 | + if: ${{ success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') }} |
26 | 24 | steps: |
27 | | - - uses: actions/checkout@v3 |
28 | | - |
29 | | - - name: Get environment info |
30 | | - run: | |
31 | | - echo Docker version |
32 | | - docker --version |
33 | | - echo |
34 | | - echo Env |
35 | | - env |
36 | | -
|
37 | | - - name: Setup local.env |
38 | | - run: | |
39 | | - echo "COMPOSER_AUTH={\"github-oauth\":{\"github.com\":\""${{ secrets.GITHUB_TOKEN }}\""}}" > local.env |
| 25 | + - name: Checkout |
| 26 | + uses: actions/checkout@v5 |
40 | 27 |
|
41 | | - - name: Install dependencies |
42 | | - run: | |
43 | | - echo "Installing ecs-deploy script..." |
44 | | - mkdir -p $HOME/.local/bin |
45 | | - curl -o $HOME/.local/bin/ecs-deploy https://raw.githubusercontent.com/silinternational/ecs-deploy/master/ecs-deploy |
46 | | - chmod +x $HOME/.local/bin/ecs-deploy |
47 | | -
|
48 | | - - name: Tests |
49 | | - run: | |
50 | | - make test |
| 28 | + - name: Setup node |
| 29 | + uses: actions/setup-node@v5 |
| 30 | + with: |
| 31 | + node-version: 24 |
51 | 32 |
|
52 | | - - name: Build docker image |
| 33 | + - name: Build docker images |
53 | 34 | uses: docker/build-push-action@v4 |
54 | 35 | with: |
55 | 36 | push: false |
56 | | - tags: ${{ env.BUILD_TAG }} |
| 37 | + tags: ${{ env.BUILD_ENGINE_BUILD_TAG }} |
57 | 38 | context: . |
58 | 39 | load: true |
59 | 40 |
|
|
75 | 56 |
|
76 | 57 | - name: Push to GHCR |
77 | 58 | run: | |
78 | | - docker tag ${{ env.BUILD_TAG }} ghcr.io/sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }} |
| 59 | + docker tag ${{ env.BUILD_ENGINE_BUILD_TAG }} ghcr.io/sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }} |
79 | 60 | docker push ghcr.io/sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }} |
80 | 61 |
|
81 | 62 | - name: Configure AWS credentials (SIL) |
|
94 | 75 |
|
95 | 76 | - name: Push to AWS ECR (SIL) |
96 | 77 | run: | |
97 | | - docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}" |
98 | | - docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}" |
| 78 | + docker tag ${{ env.BUILD_ENGINE_BUILD_TAG }} "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}" |
| 79 | + docker tag ${{ env.BUILD_ENGINE_BUILD_TAG }} "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}" |
99 | 80 | docker push "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}" |
100 | 81 | docker push "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}" |
101 | 82 |
|
@@ -129,8 +110,8 @@ jobs: |
129 | 110 | if: false # Temporarily disabled - remove this line to re-enable |
130 | 111 | # if: ${{ steps.branch.outputs.EcsCluster == 'scriptoria-prd' }} # Restore this when re-enabling |
131 | 112 | run: | |
132 | | - docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}" |
133 | | - docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}" |
| 113 | + docker tag ${{ env.BUILD_ENGINE_BUILD_TAG }} "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}" |
| 114 | + docker tag ${{ env.BUILD_ENGINE_BUILD_TAG }} "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}" |
134 | 115 | docker push "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}" |
135 | 116 | docker push "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}" |
136 | 117 |
|
@@ -162,8 +143,8 @@ jobs: |
162 | 143 | - name: Push to AWS ECR (LU) |
163 | 144 | if: ${{ steps.branch.outputs.EcsCluster == 'scriptoria-stg' }} |
164 | 145 | run: | |
165 | | - docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}" |
166 | | - docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}" |
| 146 | + docker tag ${{ env.BUILD_ENGINE_BUILD_TAG }} "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}" |
| 147 | + docker tag ${{ env.BUILD_ENGINE_BUILD_TAG }} "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}" |
167 | 148 | docker push "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}" |
168 | 149 | docker push "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}" |
169 | 150 |
|
|
0 commit comments