From 526a14bf7810b02dc45421ee0c519617ddfece5e Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Mon, 8 Jul 2024 11:57:10 +0300 Subject: [PATCH 1/5] Fixed charterafrica build. Add essential files --- .github/workflows/charterafrica-deploy-dev.yml | 2 +- Dockerfile | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/charterafrica-deploy-dev.yml b/.github/workflows/charterafrica-deploy-dev.yml index 2fd34029b..5e44651e5 100644 --- a/.github/workflows/charterafrica-deploy-dev.yml +++ b/.github/workflows/charterafrica-deploy-dev.yml @@ -2,7 +2,7 @@ name: charterAFRICA | Deploy | DEV on: push: - branches: [main] + branches: [bugfix/charterafrica-prod-build] paths: - "apps/charterafrica/**" - "Dockerfile" diff --git a/Dockerfile b/Dockerfile index e0898e7cd..666cf3321 100644 --- a/Dockerfile +++ b/Dockerfile @@ -201,7 +201,11 @@ COPY --from=charterafrica-builder --chown=nextjs:nodejs /workspace/node_modules # Since we can't use output: "standalone", copy all app's dependencies COPY --from=charterafrica-builder --chown=nextjs:nodejs /workspace/apps/charterafrica/node_modules ./apps/charterafrica/node_modules - +COPY --from=charterafrica-builder --chown=nextjs:nodejs /workspace/apps/charterafrica/next.config.js ./apps/charterafrica/next.config.js +COPY --from=charterafrica-builder --chown=nextjs:nodejs /workspace/apps/charterafrica/.env ./apps/charterafrica/.env +COPY --from=charterafrica-builder --chown=nextjs:nodejs /workspace/apps/charterafrica/migrations ./apps/charterafrica/migrations +COPY --from=charterafrica-builder --chown=nextjs:nodejs /workspace/apps/charterafrica/app.json ./apps/charterafrica/app.json +COPY --from=charterafrica-builder --chown=nextjs:nodejs /workspace/apps/charterafrica/scripts ./apps/charterafrica/scripts # Next.js # Public assets COPY --from=charterafrica-builder --chown=nextjs:nodejs /workspace/apps/charterafrica/public ./apps/charterafrica/public From 0c9726e7d43a01e504317f24d545051a2c9a302b Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Mon, 8 Jul 2024 12:01:12 +0300 Subject: [PATCH 2/5] Reverted the minor fix we had added --- apps/charterafrica/src/lib/data/local/index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/charterafrica/src/lib/data/local/index.js b/apps/charterafrica/src/lib/data/local/index.js index 4299136d3..6ca719ebe 100644 --- a/apps/charterafrica/src/lib/data/local/index.js +++ b/apps/charterafrica/src/lib/data/local/index.js @@ -25,11 +25,7 @@ export async function getServerSideTags(collection, context) { return getTags(collection, api, context); } -export async function getPageServerSideProps({ - locale = "en", - ...contextWithoutLocale -}) { - const context = { ...contextWithoutLocale, locale }; +export async function getPageServerSideProps(context) { const props = await getPageProps(api, context); if (!props) { From efe23685a12fab2c477a3792b4792640861690a5 Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Mon, 8 Jul 2024 12:12:45 +0300 Subject: [PATCH 3/5] Revert deploy branch --- .github/workflows/charterafrica-deploy-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/charterafrica-deploy-dev.yml b/.github/workflows/charterafrica-deploy-dev.yml index 5e44651e5..2fd34029b 100644 --- a/.github/workflows/charterafrica-deploy-dev.yml +++ b/.github/workflows/charterafrica-deploy-dev.yml @@ -2,7 +2,7 @@ name: charterAFRICA | Deploy | DEV on: push: - branches: [bugfix/charterafrica-prod-build] + branches: [main] paths: - "apps/charterafrica/**" - "Dockerfile" From 3c76dfc36c6878268fb361ec8a5ea575e9bda1e0 Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Mon, 8 Jul 2024 12:17:54 +0300 Subject: [PATCH 4/5] Bumped charterafrica version --- apps/charterafrica/contrib/dokku/Dockerfile | 2 +- apps/charterafrica/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/charterafrica/contrib/dokku/Dockerfile b/apps/charterafrica/contrib/dokku/Dockerfile index 352275f24..2696fe83c 100644 --- a/apps/charterafrica/contrib/dokku/Dockerfile +++ b/apps/charterafrica/contrib/dokku/Dockerfile @@ -1 +1 @@ -FROM codeforafrica/charterafrica-ui:0.1.28 +FROM codeforafrica/charterafrica-ui:0.1.29 diff --git a/apps/charterafrica/package.json b/apps/charterafrica/package.json index c10a368cf..42381ba23 100644 --- a/apps/charterafrica/package.json +++ b/apps/charterafrica/package.json @@ -1,6 +1,6 @@ { "name": "charterafrica", - "version": "0.1.28", + "version": "0.1.29", "private": true, "author": "Code for Africa ", "description": "This is the official code for https://charter.africa site", From e7a39d0c973629f4a84982aa2eb59df3e4927608 Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Mon, 8 Jul 2024 14:00:05 +0300 Subject: [PATCH 5/5] Fix Dockerfile --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 666cf3321..7c054e264 100644 --- a/Dockerfile +++ b/Dockerfile @@ -312,7 +312,9 @@ COPY --from=codeforafrica-builder --chown=nextjs:nodejs /workspace/node_modules # Since we can't use output: "standalone", copy all app's dependencies COPY --from=codeforafrica-builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/node_modules ./apps/codeforafrica/node_modules - +COPY --from=codeforafrica-builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/next.config.js ./apps/codeforafrica/next.config.js +COPY --from=codeforafrica-builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/.env ./apps/codeforafrica/.env +COPY --from=codeforafrica-builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/migrations ./apps/codeforafrica/migrations # Next.js # Public assets COPY --from=codeforafrica-builder --chown=nextjs:nodejs /workspace/apps/codeforafrica/public ./apps/codeforafrica/public @@ -403,7 +405,8 @@ RUN set -ex \ # PNPM # symlink some dependencies COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/node_modules ./node_modules - +COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/apps/roboshield/next.config.js ./apps/roboshield/next.config.js +COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/apps/roboshield/.env ./apps/roboshield/.env # Since we can't use output: "standalone", copy all app's dependencies COPY --from=roboshield-builder --chown=nextjs:nodejs /workspace/apps/roboshield/node_modules ./apps/roboshield/node_modules