Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 33 additions & 9 deletions .github/workflows/docker-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ on:
workflow_dispatch:
schedule:
- cron: "0 5 * * MON"
push:
branches:
- release
- master
paths:
- "deploy/docker/base.dockerfile"
workflow_call:
inputs:
tag:
description: "Docker tag override (e.g. release, nightly). Defaults to branch-based detection."
required: false
type: string
default: ""

jobs:
build-docker:
Expand All @@ -25,6 +26,24 @@ jobs:
steps:
- name: Checkout the head commit of the branch
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check if base.dockerfile changed
id: check
if: github.event_name == 'workflow_call'
run: |
if [[ -n "${{ github.event.before }}" ]]; then
range="${{ github.event.before }}..${{ github.sha }}"
else
range="HEAD~1..HEAD"
fi

if git diff --name-only "$range" | grep -qx "deploy/docker/base.dockerfile"; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi

- name: Login to DockerHub
uses: docker/login-action@v3
Expand All @@ -35,16 +54,21 @@ jobs:
- name: Get tag
id: tag
run: |
tag="${GITHUB_REF_NAME//\//-}"
if [[ "$tag" == master ]]; then
tag=nightly
if [[ -n "${{ inputs.tag }}" ]]; then
tag="${{ inputs.tag }}"
else
tag="${GITHUB_REF_NAME//\//-}"
if [[ "$tag" == master ]]; then
tag=nightly
fi
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"

- name: Set up Depot CLI
uses: depot/setup-action@v1

- name: Build and push base image
if: steps.check.outputs.changed != 'false'
uses: depot/build-push-action@v1
with:
project: ${{ secrets.DEPOT_PROJECT_ID }}
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,14 @@ jobs:
path: app/client/packages/rts/rts-dist.tar
overwrite: true

build-base-image:
uses: ./.github/workflows/docker-base-image.yml
secrets: inherit
with:
tag: nightly

package:
needs: [prelude, client-build, server-build, rts-build]
needs: [prelude, client-build, server-build, rts-build, build-base-image]

runs-on: ubuntu-latest
permissions:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/test-build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ on:
- "app/server/**"
- "app/client/packages/rts/**"
- "!app/client/cypress/manual_TestSuite/**"
- "deploy/docker/base.dockerfile"

jobs:
setup:
Expand Down Expand Up @@ -87,8 +88,12 @@ jobs:
with:
pr: 0

build-base-image:
uses: ./.github/workflows/docker-base-image.yml
secrets: inherit

build-docker-image:
needs: [client-build, server-build, rts-build]
needs: [client-build, server-build, rts-build, build-base-image]
# Only run if the build step is successful
if: success()
name: build-docker-image
Expand Down