From cf9df467968593cf656d2a8dbd7001b7968e57a9 Mon Sep 17 00:00:00 2001 From: kelvin kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:09:11 +0300 Subject: [PATCH 1/2] unify codeforafrica's MONGODB_URL to DATABASE_URL Matches the naming already used by roboshield/trustlab/climatemappedafrica/ charterafrica. --- apps/codeforafrica/payload.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/codeforafrica/payload.config.ts b/apps/codeforafrica/payload.config.ts index bae5c65c63..8c91a5c9c6 100644 --- a/apps/codeforafrica/payload.config.ts +++ b/apps/codeforafrica/payload.config.ts @@ -60,7 +60,7 @@ export default buildConfig({ serverURL: appURL, editor: slateEditor({}), db: mongooseAdapter({ - url: process.env.MONGODB_URL, + url: process.env.DATABASE_URL, migrationDir: process.env.MIGRATIONS_DIR, }), collections: [ From 014bd1efe2c6173092991acdd006697b1288fc7b Mon Sep 17 00:00:00 2001 From: kelvin kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:09:32 +0300 Subject: [PATCH 2/2] migrate codeforafrica builds to Docker Bake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds docker/apps/codeforafrica/Dockerfile and a bake target following the climatemappedafrica/charterafrica/roboshield/trustlab pattern: turbo-prune based multi-stage build, secrets mounted via BuildKit instead of build args, and CI wired through the shared _bake-and-push.yml reusable workflow. Unlike charterafrica, codeforafrica deploys to real DEV and PROD Dokku apps today, so this preserves the pre-bake pipeline's DEV/PROD split exactly: each environment gets its own build (matching roboshield's precedent, since codeforafrica bakes an environment-specific NEXT_PUBLIC_APP_URL into the client bundle) and its own Mongo secret (CODEFORAFRICA_MONGO_URL for DEV, with the Dokku app name appended per the pre-bake workflow's convention; CODEFORAFRICA_MONGODB_URL for PROD, already a full connection string). The DockerHub repository name (codeforafrica/codeforafrica-ui) is preserved as well, since the live Dokku apps already pull images by that exact name. NEXT_PUBLIC_APP_NAME and NEXT_PUBLIC_APP_LOGO_URL are public config values that happen to be stored as GitHub Secrets already; they're passed through as bake --set overrides from _build-codeforafrica.yml rather than modifying the shared _bake-and-push.yml, keeping this app-specific quirk contained. PROD's NEXT_PUBLIC_APP_URL is left pointing at the same (unusual, .dev.) domain the pre-bake PROD workflow already used — not a regression, and not this migration's job to fix. --- .github/workflows/_build-codeforafrica.yml | 80 ++++++++++++ .github/workflows/codeforafrica.yml | 138 +++++++++++++++++++++ .github/workflows/pr-build.yml | 31 +++++ Makefile | 2 +- docker-bake.hcl | 21 +++- docker-compose.yml | 12 +- docker/README.md | 2 +- docker/apps/codeforafrica/Dockerfile | 85 +++++++++++++ scripts/pr-build-targets.mjs | 7 ++ scripts/pr-build-targets.test.mjs | 2 + 10 files changed, 366 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/_build-codeforafrica.yml create mode 100644 .github/workflows/codeforafrica.yml create mode 100644 docker/apps/codeforafrica/Dockerfile diff --git a/.github/workflows/_build-codeforafrica.yml b/.github/workflows/_build-codeforafrica.yml new file mode 100644 index 0000000000..a4a2cb2288 --- /dev/null +++ b/.github/workflows/_build-codeforafrica.yml @@ -0,0 +1,80 @@ +name: Reusable Build | codeforAFRICA + +on: + workflow_call: + inputs: + tag: + required: true + type: string + description: "Image tag to build or push" + push: + required: true + type: boolean + description: "Whether to push the built image to the registry" + base_tag: + required: true + type: string + description: "Published base image tag to build from" + app_url: + required: true + type: string + description: "NEXT_PUBLIC_APP_URL baked into the client bundle (public, not a secret)" + sentry_environment: + required: true + type: string + description: "Sentry environment baked into the app" + set: + required: false + type: string + default: "" + description: "Additional bake --set overrides" + secrets: + DOCKER_HUB_USERNAME: + required: false + DOCKER_HUB_ACCESS_TOKEN: + required: false + DATABASE_URL: + required: false + PAYLOAD_SECRET: + required: false + SENTRY_AUTH_TOKEN: + required: false + SENTRY_ORG: + required: false + SENTRY_PROJECT: + required: false + # Not genuine secrets (public app name/logo, inlined into the client + # bundle by design) but stored as GitHub Secrets today — plumbed + # through here rather than as bake Variables to avoid a GitHub + # Variable migration, matching NEXT_PUBLIC_SENTRY_DSN's precedent. + NEXT_PUBLIC_APP_NAME: + required: false + NEXT_PUBLIC_APP_LOGO_URL: + required: false + +jobs: + build: + permissions: + actions: read + contents: read + uses: ./.github/workflows/_bake-and-push.yml + with: + target: codeforafrica + target_os: '["ubuntu-24.04-arm"]' + base_tag: ${{ inputs.base_tag }} + tag: ${{ inputs.tag }} + push: ${{ inputs.push }} + set: | + codeforafrica.args.NEXT_PUBLIC_APP_URL=${{ inputs.app_url }} + codeforafrica.args.SENTRY_ENVIRONMENT=${{ inputs.sentry_environment }} + codeforafrica.args.NEXT_PUBLIC_APP_NAME=${{ secrets.NEXT_PUBLIC_APP_NAME }} + codeforafrica.args.NEXT_PUBLIC_APP_LOGO_URL=${{ secrets.NEXT_PUBLIC_APP_LOGO_URL }} + ${{ inputs.set }} + secrets: + DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} + DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + DATABASE_URL: ${{ secrets.DATABASE_URL }} + PAYLOAD_SECRET: ${{ secrets.PAYLOAD_SECRET }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} diff --git a/.github/workflows/codeforafrica.yml b/.github/workflows/codeforafrica.yml new file mode 100644 index 0000000000..6c8baeac84 --- /dev/null +++ b/.github/workflows/codeforafrica.yml @@ -0,0 +1,138 @@ +name: codeforAFRICA + +on: + push: + branches: + - main + paths: + - "apps/codeforafrica/**" + - "docker/apps/codeforafrica/**" + - "docker-bake.hcl" + - ".github/workflows/_bake-and-push.yml" + - ".github/workflows/_build-codeforafrica.yml" + - ".github/workflows/codeforafrica.yml" + +permissions: + actions: read + contents: read + +concurrency: + group: "${{ github.workflow }} @ ${{ github.ref }}" + cancel-in-progress: true + +jobs: + # Checks whether apps/codeforafrica/package.json has a version bump. + # The prod deploy is gated on this: every push triggers a dev build+deploy, + # only a version bump triggers a prod build+deploy. + version-check: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-24.04] + permissions: + contents: read + outputs: + changed: ${{ steps.check.outputs.changed }} + version: ${{ steps.check.outputs.version }} + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v6 + with: + node-version-file: "package.json" + + - name: Check if version is bumped + id: check + uses: EndBug/version-check@v3 + with: + diff-search: true + file-name: apps/codeforafrica/package.json + + # Builds the DEV image and pushes it to DockerHub on every push. Matches + # the pre-bake workflow's DEV/PROD split: each is a separate build using + # its own canonical URL and its own Mongo secret. + # + # Required GitHub Secrets: + # CODEFORAFRICA_MONGO_URL, CODEFORAFRICA_PAYLOAD_SECRET, + # CODEFORAFRICA_SENTRY_PROJECT, NEXT_PUBLIC_CODEFORAFRICA_APP_NAME, + # NEXT_PUBLIC_CODEFORAFRICA_APP_LOGO_URL, SENTRY_AUTH_TOKEN, SENTRY_ORG, + # UI_BASE_TAG (var) + build-dev: + permissions: + actions: read + contents: read + uses: ./.github/workflows/_build-codeforafrica.yml + with: + base_tag: ${{ vars.UI_BASE_TAG }} + tag: ${{ github.sha }} + push: true + app_url: "https://codeforafrica-ui.dev.codeforafrica.org" + sentry_environment: development + secrets: + DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} + DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + # The pre-bake DEV workflow appends the Dokku app name to this secret + # (a shared Mongo host, disambiguated by database name per app). + DATABASE_URL: "${{ secrets.CODEFORAFRICA_MONGO_URL }}/codeforafrica-ui" + PAYLOAD_SECRET: ${{ secrets.CODEFORAFRICA_PAYLOAD_SECRET }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.CODEFORAFRICA_SENTRY_PROJECT }} + NEXT_PUBLIC_APP_NAME: ${{ secrets.NEXT_PUBLIC_CODEFORAFRICA_APP_NAME }} + NEXT_PUBLIC_APP_LOGO_URL: ${{ secrets.NEXT_PUBLIC_CODEFORAFRICA_APP_LOGO_URL }} + + deploy-dev: + needs: build-dev + permissions: {} + uses: ./.github/workflows/push-to-dokku.yml + with: + git_remote_url: "ssh://azureuser@ui-1.dev.codeforafrica.org/codeforafrica-ui" + deploy_docker_image: "codeforafrica/codeforafrica-ui:${{ github.sha }}" + secrets: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + + # Builds the PROD image only when the package.json version is bumped, using + # the PROD canonical URL and the semver tag. + build-prod: + needs: version-check + if: needs.version-check.outputs.changed == 'true' + permissions: + actions: read + contents: read + uses: ./.github/workflows/_build-codeforafrica.yml + with: + base_tag: ${{ vars.UI_BASE_TAG }} + tag: ${{ needs.version-check.outputs.version }} + push: true + # Matches the pre-bake PROD workflow's existing (if unusual) value — + # not changed here since that's a pre-existing app config question, + # not something this build-tooling migration should alter. + app_url: "https://cfa.dev.codeforafrica.org" + sentry_environment: production + set: | + codeforafrica.tags+=codeforafrica/codeforafrica-ui:latest + secrets: + DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} + DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + # PROD uses a distinct secret from DEV — a dedicated, full connection + # string (no app-name path appended), matching the pre-bake workflow. + DATABASE_URL: ${{ secrets.CODEFORAFRICA_MONGODB_URL }} + PAYLOAD_SECRET: ${{ secrets.CODEFORAFRICA_PAYLOAD_SECRET }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.CODEFORAFRICA_SENTRY_PROJECT }} + NEXT_PUBLIC_APP_NAME: ${{ secrets.NEXT_PUBLIC_CODEFORAFRICA_APP_NAME }} + NEXT_PUBLIC_APP_LOGO_URL: ${{ secrets.NEXT_PUBLIC_CODEFORAFRICA_APP_LOGO_URL }} + + deploy-prod: + needs: [version-check, build-prod] + if: needs.version-check.outputs.changed == 'true' + permissions: {} + uses: ./.github/workflows/push-to-dokku.yml + with: + git_remote_url: "ssh://dokku@ui-2.prod.codeforafrica.org/codeforafrica-ui" + deploy_docker_image: "codeforafrica/codeforafrica-ui:${{ needs.version-check.outputs.version }}" + secrets: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 0252a0a82d..82258b2a36 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -5,11 +5,13 @@ on: types: [opened, synchronize, reopened, ready_for_review] paths: - "apps/climatemappedafrica/**" + - "apps/codeforafrica/**" - "apps/pesayetu/**" - "apps/roboshield/**" - "apps/techlabblog/**" - "apps/trustlab/**" - "docker/apps/climatemappedafrica/**" + - "docker/apps/codeforafrica/**" - "docker/apps/pesayetu/**" - "docker/apps/roboshield/**" - "docker/apps/techlabblog/**" @@ -25,11 +27,13 @@ on: - "scripts/pr-build-targets.test.mjs" - ".github/workflows/_bake-and-push.yml" - ".github/workflows/_build-climatemappedafrica.yml" + - ".github/workflows/_build-codeforafrica.yml" - ".github/workflows/_build-pesayetu.yml" - ".github/workflows/_build-roboshield.yml" - ".github/workflows/_build-techlabblog.yml" - ".github/workflows/_build-trustlab.yml" - ".github/workflows/climatemappedafrica.yml" + - ".github/workflows/codeforafrica.yml" - ".github/workflows/pesayetu.yml" - ".github/workflows/pr-build.yml" - ".github/workflows/roboshield.yml" @@ -123,6 +127,33 @@ jobs: DATABASE_URL: ${{ secrets.CLIMATEMAPPEDAFRICA_MONGO_URL }} PAYLOAD_SECRET: pr-build-unused + build-codeforafrica: + name: Build codeforafrica image + needs: affected + if: ${{ contains(fromJSON(needs.affected.outputs.targets), 'codeforafrica') }} + permissions: + actions: read + contents: read + uses: ./.github/workflows/_build-codeforafrica.yml + with: + base_tag: ${{ vars.UI_BASE_TAG }} + tag: pr-${{ github.event.pull_request.number }}-${{ github.sha }} + push: false + app_url: "http://localhost:3000" + sentry_environment: ci + secrets: + # The custom server connects to MongoDB via payload.init() before + # spawning `next build`, so — like the other Payload-backed migrated + # apps — PR builds need a genuinely reachable database, not a dummy + # value. + DATABASE_URL: "${{ secrets.CODEFORAFRICA_MONGO_URL }}/codeforafrica-ui" + PAYLOAD_SECRET: pr-build-unused + SENTRY_AUTH_TOKEN: pr-build-unused + SENTRY_ORG: pr-build-unused + SENTRY_PROJECT: pr-build-unused + NEXT_PUBLIC_APP_NAME: pr-build-unused + NEXT_PUBLIC_APP_LOGO_URL: pr-build-unused + build-pesayetu: name: Build pesayetu image needs: affected diff --git a/Makefile b/Makefile index f4ba8537f4..a87534271f 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ climatemappedafrica: ./scripts/bake-up.sh climatemappedafrica codeforafrica: - ./scripts/dc.sh codeforafrica + ./scripts/bake-up.sh codeforafrica down: $(COMPOSE_BUILD_ENV) $(COMPOSE) down --volumes diff --git a/docker-bake.hcl b/docker-bake.hcl index 77bc7f1bc5..570b8d805d 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -71,7 +71,7 @@ group "base" { } group "apps" { - targets = ["climatemappedafrica", "pesayetu", "roboshield", "techlabblog", "trustlab"] + targets = ["climatemappedafrica", "codeforafrica", "pesayetu", "roboshield", "techlabblog", "trustlab"] } # Prefer explicit targets/groups for predictability. @@ -175,6 +175,25 @@ target "climatemappedafrica" { # mounts, matching pesayetu's approach. } +target "codeforafrica" { + inherits = ["_payload-app-runner"] + dockerfile = "docker/apps/codeforafrica/Dockerfile" + # "-ui" suffix matches the pre-bake DockerHub repository name + # (codeforafrica/codeforafrica-ui) that the live Dokku apps already pull by. + tags = ["${REGISTRY}codeforafrica-ui:${TAG}"] + args = { + NEXT_PUBLIC_APP_URL = "${NEXT_PUBLIC_APP_URL}" + SENTRY_ENVIRONMENT = "${SENTRY_ENVIRONMENT}" + } + # database_url/payload_secret/sentry_auth_token/org/project are all + # inherited from _payload-app-runner/_app. NEXT_PUBLIC_APP_NAME and + # NEXT_PUBLIC_APP_LOGO_URL are set via --set overrides at the workflow + # level (see _build-codeforafrica.yml), since they're sourced from + # GitHub Secrets rather than Variables — matching the legacy pipeline, + # which never wired NEXT_PUBLIC_IMAGE_DOMAINS/NEXT_PUBLIC_IMAGE_UNOPTIMIZED + # as build args either, despite next.config.js reading them. +} + # pesayetu fetches content from WordPress (WPGraphQL) during static generation, # so these are real build args, not just runtime config. They default to empty # so the image still builds without them; pages that depend on WordPress data diff --git a/docker-compose.yml b/docker-compose.yml index 1a5b1adb4e..e69142b6a9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -48,17 +48,7 @@ services: - 3000:3000 codeforafrica: - build: - secrets: - - mongodb_url - - payload_secret - - sentry_auth_token - - sentry_org - - sentry_project - context: . - target: codeforafrica-runner - args: - - SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT} + image: codeforafrica/codeforafrica-ui:${TAG:-local} env_file: - path: ./apps/codeforafrica/.env - path: ./apps/codeforafrica/.env.local diff --git a/docker/README.md b/docker/README.md index 6c8381df59..58a4209c75 100644 --- a/docker/README.md +++ b/docker/README.md @@ -20,7 +20,7 @@ Apps checked below have migrated to the per-app Dockerfile pattern under - [ ] `charterafrica` - [ ] `civicsignalblog` - [x] `climatemappedafrica` -- [ ] `codeforafrica` +- [x] `codeforafrica` - [x] `pesayetu` - [x] `roboshield` - [x] `techlabblog` diff --git a/docker/apps/codeforafrica/Dockerfile b/docker/apps/codeforafrica/Dockerfile new file mode 100644 index 0000000000..8e720cf9a4 --- /dev/null +++ b/docker/apps/codeforafrica/Dockerfile @@ -0,0 +1,85 @@ +# syntax=docker/dockerfile:1 + +# ui_builder_base / ui_runner_base: Docker named context references use underscores +# because hyphens are invalid in context names. The bake targets are still named +# ui-builder-base and ui-runner-base — only the FROM reference uses underscores. +FROM ui_builder_base AS pruned + +COPY . . + +# turbo is pre-installed in ui-builder-base — no network call needed here. +RUN turbo prune --docker --out-dir /workspace/out codeforafrica + +FROM ui_builder_base AS deps + +COPY --from=pruned /workspace/out/json/ ./ +COPY --from=pruned /workspace/out/pnpm-lock.yaml ./ + +RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store,sharing=shared \ + pnpm install --frozen-lockfile + +FROM ui_builder_base AS builder + +ARG NEXT_PUBLIC_APP_URL \ + NEXT_PUBLIC_APP_NAME="Code for Africa" \ + NEXT_PUBLIC_APP_LOGO_URL \ + SENTRY_ENVIRONMENT + +ENV NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL} \ + NEXT_PUBLIC_APP_NAME=${NEXT_PUBLIC_APP_NAME} \ + NEXT_PUBLIC_APP_LOGO_URL=${NEXT_PUBLIC_APP_LOGO_URL} \ + SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT} + +COPY --from=deps /workspace/node_modules ./node_modules +COPY --from=deps /workspace/apps/codeforafrica/node_modules ./apps/codeforafrica/node_modules +# turbo WARNs when lockfile is missing during build +COPY --from=pruned /workspace/out/pnpm-lock.yaml ./pnpm-lock.yaml +COPY --from=pruned /workspace/out/full/ ./ + +# Payload's admin panel needs a serverURL at build time; the real value is +# supplied at runtime via Dokku config, not baked into the image. +ENV PAYLOAD_PUBLIC_APP_URL=http://localhost:3000 + +# The custom server (server.ts) connects to MongoDB via payload.init() before +# spawning `next build`, so — like climatemappedafrica — this build genuinely +# needs a reachable database, not just a well-formed URL. +RUN --mount=type=secret,id=database_url,env=DATABASE_URL \ + --mount=type=secret,id=payload_secret,env=PAYLOAD_SECRET \ + --mount=type=secret,id=sentry_auth_token,env=SENTRY_AUTH_TOKEN \ + --mount=type=secret,id=sentry_org,env=SENTRY_ORG \ + --mount=type=secret,id=sentry_project,env=SENTRY_PROJECT \ + pnpm --filter './apps/codeforafrica' build:next + +ENV PAYLOAD_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL} +RUN pnpm --filter './apps/codeforafrica' build-payload + +FROM ui_runner_base AS runner + +ARG NEXT_PUBLIC_APP_LOGO_URL \ + PAYLOAD_CONFIG_PATH="dist/payload.config.js" + +ENV NEXT_PUBLIC_APP_LOGO_URL=${NEXT_PUBLIC_APP_LOGO_URL} \ + PAYLOAD_CONFIG_PATH=${PAYLOAD_CONFIG_PATH} + +RUN set -ex \ + && mkdir -p ./apps/codeforafrica/.next \ + && chown nextjs:nodejs ./apps/codeforafrica/.next + +# codeforafrica doesn't use output: "standalone", so the full node_modules +# and .next folder (not just the standalone bundle) are needed at runtime. +COPY --from=builder --chown=nextjs:nodejs /workspace/node_modules ./node_modules +COPY --from=builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/node_modules ./apps/codeforafrica/node_modules +COPY --from=builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/next.config.js ./apps/codeforafrica/next.config.js +COPY --from=builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/.env ./apps/codeforafrica/.env +COPY --from=builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/migrations ./apps/codeforafrica/migrations +COPY --from=builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/public ./apps/codeforafrica/public +COPY --from=builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/.next ./apps/codeforafrica/.next +COPY --from=builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/dist ./apps/codeforafrica/dist +COPY --from=builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/build ./apps/codeforafrica/build + +WORKDIR /workspace/apps/codeforafrica + +USER nextjs + +# Custom server to run Payload and Next.js in the same app +CMD ["node", "dist/server.js"] diff --git a/scripts/pr-build-targets.mjs b/scripts/pr-build-targets.mjs index da5de81567..e5a54a8efc 100644 --- a/scripts/pr-build-targets.mjs +++ b/scripts/pr-build-targets.mjs @@ -17,6 +17,12 @@ export const BUILD_TARGET_CONFIG = { "docker/apps/climatemappedafrica/", ], }, + codeforafrica: { + directBuildInputPaths: [ + ".github/workflows/codeforafrica.yml", + "docker/apps/codeforafrica/", + ], + }, pesayetu: { directBuildInputPaths: [ ".github/workflows/pesayetu.yml", @@ -47,6 +53,7 @@ export const BUILD_TARGET_CONFIG = { const GLOBAL_BUILD_FILES = new Set([ ".github/workflows/_bake-and-push.yml", ".github/workflows/_build-climatemappedafrica.yml", + ".github/workflows/_build-codeforafrica.yml", ".github/workflows/_build-pesayetu.yml", ".github/workflows/_build-roboshield.yml", ".github/workflows/_build-techlabblog.yml", diff --git a/scripts/pr-build-targets.test.mjs b/scripts/pr-build-targets.test.mjs index 4e5f83e715..b9a5427c81 100644 --- a/scripts/pr-build-targets.test.mjs +++ b/scripts/pr-build-targets.test.mjs @@ -23,6 +23,7 @@ describe("pr-build-targets", () => { assert.deepEqual( directBuildTargets([ "docker/apps/climatemappedafrica/Dockerfile", + "docker/apps/codeforafrica/Dockerfile", "docker/apps/pesayetu/Dockerfile", "docker/apps/roboshield/Dockerfile", "docker/apps/techlabblog/Dockerfile", @@ -30,6 +31,7 @@ describe("pr-build-targets", () => { ]), [ "climatemappedafrica", + "codeforafrica", "pesayetu", "roboshield", "techlabblog",