Skip to content

Commit 0f73452

Browse files
authored
ci: docker image always released as -dev (#2358)
1 parent e811ad4 commit 0f73452

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.github/actions/docker/action.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ runs:
190190
platforms: ${{ inputs.platform }}
191191
secret-files: |
192192
AWS=${{ env.HOME }}/.aws/credentials
193-
build-args: ${{ steps.sccache.outputs.env_vars }}
193+
build-args: |
194+
CARGO_BUILD_PROFILE=${{ inputs.cargo_profile }}
195+
${{ steps.sccache.outputs.env_vars }}
194196
cache-from: ${{ steps.layer_cache_settings.outputs.cache_from }}
195197
cache-to: ${{ steps.layer_cache_settings.outputs.cache_to }}
196198
outputs: type=image,name=${{ inputs.image_org }}/${{ inputs.image_name }},push-by-digest=${{ inputs.push_tags != 'true' }},name-canonical=true,push=true

.github/workflows/release-docker-image.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ jobs:
6868
cache_endpoint: ${{ vars.CACHE_S3_ENDPOINT }}
6969
cache_access_key_id: ${{ secrets.CACHE_KEY_ID }}
7070
cache_secret_access_key: ${{ secrets.CACHE_SECRET_KEY }}
71+
# On release, we generate a new "base" image, so we need to save cache to name manifest, like '.../drive'
72+
cache_to_name: ${{ github.event_name == 'release' && 'true' || 'false' }}
7173

7274
- name: Export digest
7375
run: |

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ RUN if [[ "$TARGETARCH" == "arm64" ]] ; then export PROTOC_ARCH=aarch_64; else e
131131
# Switch to clang
132132
RUN rm /usr/bin/cc && ln -s /usr/bin/clang /usr/bin/cc
133133

134-
# Select whether we want dev or release
135-
ONBUILD ARG CARGO_BUILD_PROFILE=dev
136-
137134
ARG NODE_ENV=production
138135
ENV NODE_ENV=${NODE_ENV}
139136

@@ -326,6 +323,10 @@ RUN --mount=type=secret,id=AWS \
326323
--no-track \
327324
--no-confirm
328325

326+
327+
# Select whether we want dev or release
328+
ONBUILD ARG CARGO_BUILD_PROFILE=dev
329+
329330
#
330331
# Rust build planner to speed up builds
331332
#

0 commit comments

Comments
 (0)