From 1941a68d342200e1052118f6d3a3850d02141d82 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Sat, 31 May 2025 00:50:16 +0530 Subject: [PATCH 01/13] add algolia search Signed-off-by: amanycodes --- website/docusaurus.config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 4c662df45..d9d61bec7 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -80,6 +80,12 @@ const config = { theme: lightCodeTheme, darkTheme: darkCodeTheme, }, + algolia: { + appId: 'V764HJRQUN', + apiKey: 'd590e629131c1318f2b996bc14efdfa8', + indexName: 'project-copaceticio', + contextualSearch: true, + } }), }; From ab8ce4e15bd6df14cbc767c8f19c3aacac743700 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Fri, 6 Jun 2025 06:24:02 +0530 Subject: [PATCH 02/13] safe keys Signed-off-by: amanycodes --- .gitignore | 1 + website/docusaurus.config.js | 5 +++-- website/package.json | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 280e9f7ad..51a2f7d78 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ build/ npm-debug.log* yarn-debug.log* yarn-error.log* +.env diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index d9d61bec7..ce1fcd0fa 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -3,6 +3,7 @@ const lightCodeTheme = require('prism-react-renderer').themes.github; const darkCodeTheme = require('prism-react-renderer').themes.dracula; +require('dotenv').config() /** @type {import('@docusaurus/types').Config} */ const config = { @@ -81,8 +82,8 @@ const config = { darkTheme: darkCodeTheme, }, algolia: { - appId: 'V764HJRQUN', - apiKey: 'd590e629131c1318f2b996bc14efdfa8', + appId: process.env.ALGOLIA_ID, + apiKey: process.env.ALGOLIA_API_KEY, indexName: 'project-copaceticio', contextualSearch: true, } diff --git a/website/package.json b/website/package.json index 54784dd46..51d949953 100644 --- a/website/package.json +++ b/website/package.json @@ -19,6 +19,7 @@ "@docusaurus/preset-classic": "3.8.0", "@mdx-js/react": "^3.1.0", "clsx": "^2.1.1", + "dotenv": "^16.5.0", "prism-react-renderer": "^2.4.1", "react": "^19.1.0", "react-dom": "^19.1.0" From 7e7e93bc2b5c52b77be3e09f2c7add9500dfd262 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Fri, 6 Jun 2025 23:54:41 +0530 Subject: [PATCH 03/13] updated yarn lockfile Signed-off-by: amanycodes --- website/yarn.lock | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/yarn.lock b/website/yarn.lock index 8fbbb03e9..b2b4d46f0 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -4113,6 +4113,11 @@ dot-prop@^6.0.1: dependencies: is-obj "^2.0.0" +dotenv@^16.5.0: + version "16.5.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.5.0.tgz#092b49f25f808f020050051d1ff258e404c78692" + integrity sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg== + duplexer@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" From 7110f6f359925da312af128286433def18ff9662 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Sat, 7 Jun 2025 00:06:05 +0530 Subject: [PATCH 04/13] added vars to github workflow Signed-off-by: amanycodes --- .github/workflows/deploy-docs.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 04fe7c731..85aa1a4a9 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -52,7 +52,12 @@ jobs: ${{ runner.os }}-website- - run: yarn install --frozen-lockfile - - run: yarn build + + - name: Build Website + run: yarn build + env: + ALGOLIA_ID: ${{ secrets.ALGOLIA_ID}} + ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY}} # deploy only after PR is merged to main - name: Deploy to GitHub Pages From d562dfd91ad662e62a2b1f6d81d92f838ca6ad61 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Sat, 7 Jun 2025 04:02:25 +0530 Subject: [PATCH 05/13] debug github secrets Signed-off-by: amanycodes --- .github/workflows/deploy-docs.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 85aa1a4a9..7a4d4f14e 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -53,8 +53,14 @@ jobs: - run: yarn install --frozen-lockfile - - name: Build Website - run: yarn build + - name: Debug Github secrets + run: | + echo "Secrets context keys:" + echo '${{ toJson(secrets) }}' | jq -r 'keys[]' 2>/dev/null || echo "jq not available, showing raw:" + echo '${{ toJson(secrets) }}' | sed 's/"[^"]*"/***HIDDEN***/g' 2>/dev/null || echo "Could not parse secrets" + if [ -z "$ALGOLIA_ID" ]; then echo "ALGOLIA_ID is empty or not set"; else echo "ALGOLIA_ID is set (first 4: ${ALGOLIA_ID:0:4}***)"; fi + if [ -z "$ALGOLIA_API_KEY" ]; then echo "ALGOLIA_API_KEY is empty or not set"; else echo "ALGOLIA_API_KEY is set (first 4: ${ALGOLIA_API_KEY:0:4}***)"; fi + env: ALGOLIA_ID: ${{ secrets.ALGOLIA_ID}} ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY}} From 5b3a9f97914414314c2bda454943b7f3e0407569 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Mon, 9 Jun 2025 21:26:08 +0530 Subject: [PATCH 06/13] added vars Signed-off-by: amanycodes --- .github/workflows/deploy-docs.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 7a4d4f14e..2ae965f59 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -60,7 +60,13 @@ jobs: echo '${{ toJson(secrets) }}' | sed 's/"[^"]*"/***HIDDEN***/g' 2>/dev/null || echo "Could not parse secrets" if [ -z "$ALGOLIA_ID" ]; then echo "ALGOLIA_ID is empty or not set"; else echo "ALGOLIA_ID is set (first 4: ${ALGOLIA_ID:0:4}***)"; fi if [ -z "$ALGOLIA_API_KEY" ]; then echo "ALGOLIA_API_KEY is empty or not set"; else echo "ALGOLIA_API_KEY is set (first 4: ${ALGOLIA_API_KEY:0:4}***)"; fi - + echo "GITHUB_REF: $GITHUB_REF" + echo "GITHUB_SHA: $GITHUB_SHA" + echo "GITHUB_REPOSITORY: $GITHUB_REPOSITORY" + echo "GITHUB_EVENT_NAME: $GITHUB_EVENT_NAME" + echo "HOME: $HOME" + echo "PATH: $PATH" + echo "CI: $CI" env: ALGOLIA_ID: ${{ secrets.ALGOLIA_ID}} ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY}} From 1778eb7c90db6b1aa9cb5880457cfa52bc156773 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Mon, 9 Jun 2025 21:34:00 +0530 Subject: [PATCH 07/13] vars Signed-off-by: amanycodes --- .github/workflows/deploy-docs.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 2ae965f59..ae530a30c 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -60,13 +60,7 @@ jobs: echo '${{ toJson(secrets) }}' | sed 's/"[^"]*"/***HIDDEN***/g' 2>/dev/null || echo "Could not parse secrets" if [ -z "$ALGOLIA_ID" ]; then echo "ALGOLIA_ID is empty or not set"; else echo "ALGOLIA_ID is set (first 4: ${ALGOLIA_ID:0:4}***)"; fi if [ -z "$ALGOLIA_API_KEY" ]; then echo "ALGOLIA_API_KEY is empty or not set"; else echo "ALGOLIA_API_KEY is set (first 4: ${ALGOLIA_API_KEY:0:4}***)"; fi - echo "GITHUB_REF: $GITHUB_REF" - echo "GITHUB_SHA: $GITHUB_SHA" - echo "GITHUB_REPOSITORY: $GITHUB_REPOSITORY" - echo "GITHUB_EVENT_NAME: $GITHUB_EVENT_NAME" - echo "HOME: $HOME" - echo "PATH: $PATH" - echo "CI: $CI" + echo '${{ toJson(vars) }}' env: ALGOLIA_ID: ${{ secrets.ALGOLIA_ID}} ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY}} From 628273ef8456eca8dea07e6aa0006a2e9b97e508 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Tue, 10 Jun 2025 23:37:01 +0530 Subject: [PATCH 08/13] github secrets Signed-off-by: amanycodes --- .github/workflows/deploy-docs.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index ae530a30c..f283237b5 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -56,14 +56,13 @@ jobs: - name: Debug Github secrets run: | echo "Secrets context keys:" - echo '${{ toJson(secrets) }}' | jq -r 'keys[]' 2>/dev/null || echo "jq not available, showing raw:" - echo '${{ toJson(secrets) }}' | sed 's/"[^"]*"/***HIDDEN***/g' 2>/dev/null || echo "Could not parse secrets" + echo '${{ toJson(secrets) }}' if [ -z "$ALGOLIA_ID" ]; then echo "ALGOLIA_ID is empty or not set"; else echo "ALGOLIA_ID is set (first 4: ${ALGOLIA_ID:0:4}***)"; fi if [ -z "$ALGOLIA_API_KEY" ]; then echo "ALGOLIA_API_KEY is empty or not set"; else echo "ALGOLIA_API_KEY is set (first 4: ${ALGOLIA_API_KEY:0:4}***)"; fi echo '${{ toJson(vars) }}' env: - ALGOLIA_ID: ${{ secrets.ALGOLIA_ID}} - ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY}} + ALGOLIA_ID: ${{ secrets.algolia.ALGOLIA_ID}} + ALGOLIA_API_KEY: ${{ secrets.algolia.ALGOLIA_API_KEY}} # deploy only after PR is merged to main - name: Deploy to GitHub Pages From 0909560e1c57e640b77475eb2d4a686621ff0c97 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Wed, 11 Jun 2025 00:20:41 +0530 Subject: [PATCH 09/13] fix secrets Signed-off-by: amanycodes --- .github/workflows/deploy-docs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index f283237b5..025a03bec 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -61,8 +61,8 @@ jobs: if [ -z "$ALGOLIA_API_KEY" ]; then echo "ALGOLIA_API_KEY is empty or not set"; else echo "ALGOLIA_API_KEY is set (first 4: ${ALGOLIA_API_KEY:0:4}***)"; fi echo '${{ toJson(vars) }}' env: - ALGOLIA_ID: ${{ secrets.algolia.ALGOLIA_ID}} - ALGOLIA_API_KEY: ${{ secrets.algolia.ALGOLIA_API_KEY}} + ALGOLIA_ID: ${{ secrets.ALGOLIA_ID }} + ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} # deploy only after PR is merged to main - name: Deploy to GitHub Pages From 56ba23dde55c548d4ba0f72ceafc7dc4fc3232b2 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Wed, 11 Jun 2025 00:40:04 +0530 Subject: [PATCH 10/13] final secrets fix Signed-off-by: amanycodes --- .github/workflows/deploy-docs.yaml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 025a03bec..54505262b 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -52,14 +52,8 @@ jobs: ${{ runner.os }}-website- - run: yarn install --frozen-lockfile - - - name: Debug Github secrets - run: | - echo "Secrets context keys:" - echo '${{ toJson(secrets) }}' - if [ -z "$ALGOLIA_ID" ]; then echo "ALGOLIA_ID is empty or not set"; else echo "ALGOLIA_ID is set (first 4: ${ALGOLIA_ID:0:4}***)"; fi - if [ -z "$ALGOLIA_API_KEY" ]; then echo "ALGOLIA_API_KEY is empty or not set"; else echo "ALGOLIA_API_KEY is set (first 4: ${ALGOLIA_API_KEY:0:4}***)"; fi - echo '${{ toJson(vars) }}' + - name: Build Website + run: yarn build env: ALGOLIA_ID: ${{ secrets.ALGOLIA_ID }} ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} From ca7e9217fb1611750785da7138cfdeadc3706a1c Mon Sep 17 00:00:00 2001 From: amanycodes Date: Tue, 17 Jun 2025 01:59:07 +0530 Subject: [PATCH 11/13] fixed workflow perms Signed-off-by: amanycodes --- .github/workflows/deploy-docs.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 3f7493bf5..d9dd4d7f0 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -14,8 +14,7 @@ on: - '.github/workflows/deploy-docs.yaml' - 'website/**' -permissions: - contents: read +permissions: read-all jobs: deploy: From a36be43deb4d5fdc0e6ce65da597faad96135af5 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Tue, 17 Jun 2025 02:02:51 +0530 Subject: [PATCH 12/13] fix perms Signed-off-by: amanycodes --- .github/workflows/deploy-docs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index d9dd4d7f0..8b71a4367 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -22,6 +22,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + pull-requests: read defaults: run: working-directory: website From fbfea3382b7f894d19b9efceb08c637873a079a5 Mon Sep 17 00:00:00 2001 From: amanycodes Date: Tue, 17 Jun 2025 02:07:57 +0530 Subject: [PATCH 13/13] reset perms Signed-off-by: amanycodes --- .github/workflows/deploy-docs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 8b71a4367..3f7493bf5 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -14,7 +14,8 @@ on: - '.github/workflows/deploy-docs.yaml' - 'website/**' -permissions: read-all +permissions: + contents: read jobs: deploy: @@ -22,7 +23,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - pull-requests: read defaults: run: working-directory: website