1717 runs-on : ubuntu-latest
1818 outputs :
1919 deploy_env : ${{ steps.set-deploy-env.outputs.result }}
20- container_tag : ${{ steps.set-container -tag.outputs.result }}
20+ image_tag : ${{ steps.set-image -tag.outputs.result }}
2121 meadow_tenant : ${{ steps.set-meadow-prefix.outputs.result }}
2222 steps :
2323 - name : Set DEPLOY_ENV from Branch Name
3030 fi
3131 env :
3232 BRANCH : ${{ github.ref }}
33- - name : Set container tag from DEPLOY_ENV
34- id : set-container -tag
33+ - name : Set image tag from DEPLOY_ENV
34+ id : set-image -tag
3535 run : |
3636 if [[ $DEPLOY_ENV == 'production' || $DEPLOY_ENV == 'staging' ]]; then
3737 echo "result=latest" >> $GITHUB_OUTPUT
@@ -53,15 +53,15 @@ jobs:
5353 - name : Output Environment Info
5454 run : |
5555 echo "Deploying to environment: ${{ steps.set-deploy-env.outputs.result }}"
56- echo "Using container tag: ${{ steps.set-container -tag.outputs.result }}"
56+ echo "Using image tag: ${{ steps.set-image -tag.outputs.result }}"
5757 echo "Using meadow tenant prefix: ${{ steps.set-meadow-prefix.outputs.result }}"
5858 build :
5959 if : ${{ !github.event.pull_request && !contains(github.event.head_commit.message, '[no-deploy]') }}
6060 runs-on : ubuntu-latest
6161 needs : get-environment
6262 env :
6363 DEPLOY_ENV : ${{ needs.get-environment.outputs.deploy_env }}
64- CONTAINER_TAG : ${{ needs.get-environment.outputs.container_tag }}
64+ IMAGE_TAG : ${{ needs.get-environment.outputs.image_tag }}
6565 MEADOW_TENANT : ${{ needs.get-environment.outputs.meadow_tenant }}
6666 steps :
6767 - uses : actions/checkout@v2
7272 GITHUB_ENV : ${{ env.GITHUB_ENV }}
7373 SECRETS : ${{ toJSON(secrets) }}
7474 - name : Extract MEADOW_VERSION from mix.exs
75- run : echo "MEADOW_VERSION=$(grep '@app_version "' mix.exs | sed -n 's/^.*"\(.*\)".*/\1/p')" >> $GITHUB_ENV
76- working-directory : app
77- - run : echo "Building Meadow v${MEADOW_VERSION} as nulib/meadow:${CONTAINER_TAG}"
75+ run : echo "MEADOW_VERSION=$(make app-version)" >> $GITHUB_ENV
76+ - run : echo "Building Meadow v${MEADOW_VERSION} as nulib/meadow:${IMAGE_TAG}"
7877 - name : Tag Meadow Release
7978 if : ${{ github.ref == 'refs/heads/main' }}
8079 run : |
@@ -86,42 +85,45 @@ jobs:
8685 - name : Login to Amazon ECR
8786 id : login-ecr
8887 uses : aws-actions/amazon-ecr-login@v1
89- - name : Determine container tags
90- id : determine-container -tags
88+ - name : Determine image tags
89+ id : determine-image -tags
9190 run : |
9291 {
9392 echo "tags<<EOF"
94- echo "${REGISTRY_NAME}/meadow:${CONTAINER_TAG }"
95- if [[ ${CONTAINER_TAG } == "latest" ]]; then
93+ echo "${REGISTRY_NAME}/meadow:${IMAGE_TAG }"
94+ if [[ ${IMAGE_TAG } == "latest" ]]; then
9695 echo "${REGISTRY_NAME}/meadow:${MEADOW_VERSION}"
9796 fi
9897 echo "EOF"
9998 } >> $GITHUB_OUTPUT
10099 env :
101100 REGISTRY_NAME : ${{ steps.login-ecr.outputs.registry }}
102- - name : Set Meadow Release Name
103- id : meadow-release
104- run : echo "name=meadow-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
101+ - name : Set Build Options
102+ id : build-options
103+ run : |
104+ echo "release_name=meadow-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
105+ echo "build_image=$(make build-image)" >> $GITHUB_OUTPUT
106+ echo "runtime_image=$(make runtime-image)" >> $GITHUB_OUTPUT
105107 - uses : docker/build-push-action@v2
106108 with :
107109 context : ./app
108110 push : true
109- tags : ${{ steps.determine-container -tags.outputs.tags }}
111+ tags : ${{ steps.determine-image -tags.outputs.tags }}
110112 build-args : |
111- BUILD_IMAGE=hexpm/elixir:1.18.2-erlang-27.3-debian-bookworm-20250224
112- RUNTIME_IMAGE=node:22-bookworm-slim
113+ BUILD_IMAGE=${{ steps.build-options.outputs.build_image }}
114+ RUNTIME_IMAGE=${{ steps.build-options.outputs.runtime_image }}
113115 HONEYBADGER_API_KEY=${{ secrets.HONEYBADGER_API_KEY }}
114116 HONEYBADGER_API_KEY_FRONTEND=${{ secrets.HONEYBADGER_API_KEY_FRONTEND }}
115117 HONEYBADGER_ENVIRONMENT=${{ env.DEPLOY_ENV }}
116118 HONEYBADGER_REVISION=${{ github.sha }}
117- RELEASE_NAME=${{ steps.meadow-release .outputs.name }}
119+ RELEASE_NAME=${{ steps.build-options .outputs.release_name }}
118120 MEADOW_TENANT=${{ env.MEADOW_TENANT }}
119121 MEADOW_VERSION=${{ env.MEADOW_VERSION }}
120122 - name : Upload Source Maps to Honeybadger
121123 run : .github/scripts/upload_source_maps.sh
122124 env :
123125 DEPLOY_ENV : ${{ env.DEPLOY_ENV }}
124- MEADOW_IMAGE : ${{ steps.login-ecr.outputs.registry }}/meadow:${{ env.CONTAINER_TAG }}
126+ MEADOW_IMAGE : ${{ steps.login-ecr.outputs.registry }}/meadow:${{ env.IMAGE_TAG }}
125127 MEADOW_VERSION : ${{ env.MEADOW_VERSION }}
126128 HONEYBADGER_API_KEY_FRONTEND : ${{ secrets.HONEYBADGER_API_KEY_FRONTEND }}
127129 HONEYBADGER_REVISION : ${{ github.sha }}
@@ -150,13 +152,12 @@ jobs:
150152 needs : get-environment
151153 env :
152154 DEPLOY_ENV : ${{ needs.get-environment.outputs.deploy_env }}
153- CONTAINER_TAG : ${{ needs.get-environment.outputs.container_tag }}
155+ IMAGE_TAG : ${{ needs.get-environment.outputs.image_tag }}
154156 MEADOW_TENANT : ${{ needs.get-environment.outputs.meadow_tenant }}
155157 steps :
156158 - uses : actions/checkout@v2
157159 - name : Extract MEADOW_VERSION from mix.exs
158- run : echo "MEADOW_VERSION=$(grep '@app_version "' mix.exs | sed -n 's/^.*"\(.*\)".*/\1/p')" >> $GITHUB_ENV
159- working-directory : app
160+ run : echo "MEADOW_VERSION=$(make app-version)" >> $GITHUB_ENV
160161 - name : Configure AWS
161162 run : .github/scripts/configure_aws.sh
162163 env :
@@ -168,13 +169,13 @@ jobs:
168169 - name : Login to Amazon ECR
169170 id : login-ecr
170171 uses : aws-actions/amazon-ecr-login@v1
171- - name : Determine container tags
172- id : determine-container -tags
172+ - name : Determine image tags
173+ id : determine-image -tags
173174 run : |
174175 {
175176 echo "tags<<EOF"
176- echo "${REGISTRY_NAME}/meadow:livebook-${CONTAINER_TAG }"
177- if [[ ${CONTAINER_TAG } == "latest" ]]; then
177+ echo "${REGISTRY_NAME}/meadow:livebook-${IMAGE_TAG }"
178+ if [[ ${IMAGE_TAG } == "latest" ]]; then
178179 echo "${REGISTRY_NAME}/meadow:livebook-${MEADOW_VERSION}"
179180 fi
180181 echo "EOF"
@@ -186,7 +187,7 @@ jobs:
186187 context : .
187188 file : ./Dockerfile.livebook
188189 push : true
189- tags : ${{ steps.determine-container -tags.outputs.tags }}
190+ tags : ${{ steps.determine-image -tags.outputs.tags }}
190191 deploy :
191192 needs :
192193 - get-environment
@@ -196,7 +197,7 @@ jobs:
196197 runs-on : ubuntu-latest
197198 env :
198199 DEPLOY_ENV : ${{ needs.get-environment.outputs.deploy_env }}
199- CONTAINER_TAG : ${{ needs.get-environment.outputs.container_tag }}
200+ IMAGE_TAG : ${{ needs.get-environment.outputs.image_tag }}
200201 MEADOW_TENANT : ${{ needs.get-environment.outputs.meadow_tenant }}
201202 steps :
202203 - uses : actions/checkout@v2
0 commit comments