From 83b007320ba38986d853f9c05d28fc3819d08f91 Mon Sep 17 00:00:00 2001 From: "Bernard \"BeroBurny\" Stojanovic" Date: Tue, 10 Dec 2024 15:06:58 +0700 Subject: [PATCH 1/3] chore: refactor cf pages ci/cd from `gopher-*`to `sprinter-*` --- .github/workflows/cd.yml | 15 +++++++++++---- .github/workflows/ci.yml | 28 ++++++++++++++++------------ 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 4222c40..c2fd108 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -49,11 +49,18 @@ jobs: - name: Publish Docs to Cloudflare Pages if: ${{ steps.release.outputs.releases_created }} - uses: cloudflare/pages-action@v1 + uses: cloudflare/wrangler-action@v3 with: + gitHubToken: ${{ secrets.GITHUB_TOKEN }} apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: 2238a825c5aca59233eab1f221f7aefb - projectName: gopher-docs-preview - directory: ./docs/build + command: pages deploy ./docs/build --project-name=sprinter-docs + + - name: Publish POC to Cloudflare Pages + if: ${{ steps.release.outputs.releases_created }} + uses: cloudflare/wrangler-action@v3 + with: gitHubToken: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.head_ref || github.ref_name }} \ No newline at end of file + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: 2238a825c5aca59233eab1f221f7aefb + command: pages deploy ./web/.svelte-kit/cloudflare --project-name=sprinter-poc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 399e3b3..0318b92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,21 +29,25 @@ jobs: run: 'yarn run test:unit' - name: "Integrations Tests" run: 'yarn run test:integrations' - - name: Publish POC to Cloudflare Pages - uses: cloudflare/pages-action@v1 + - name: Set branch name for Cloudflare Pages + id: cf-branch + run: | + if [[ "${{ github.ref_name }}" == "master" ]]; then + echo "CF_BRANCH_NAME=preview" >> $GITHUB_ENV + else + echo "CF_BRANCH_NAME=${{ github.head_ref || github.ref_name }}" >> $GITHUB_ENV + fi + - name: Publish Docs to Cloudflare Pages + uses: cloudflare/wrangler-action@v3 with: + gitHubToken: ${{ secrets.GITHUB_TOKEN }} apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: 2238a825c5aca59233eab1f221f7aefb - projectName: gopher-poc - directory: ./web/.svelte-kit/cloudflare - gitHubToken: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.head_ref || github.ref_name }} - - name: Publish Preview Docs to Cloudflare Pages - uses: cloudflare/pages-action@v1 + command: pages deploy ./docs/build --project-name=sprinter-docs --branch=${{ env.CF_BRANCH_NAME }} + - name: Publish POC to Cloudflare Pages + uses: cloudflare/wrangler-action@v3 with: + gitHubToken: ${{ secrets.GITHUB_TOKEN }} apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: 2238a825c5aca59233eab1f221f7aefb - projectName: gopher-docs-preview - directory: ./docs/build - gitHubToken: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.head_ref || github.ref_name }} \ No newline at end of file + command: pages deploy ./web/.svelte-kit/cloudflare --project-name=sprinter-poc --branch=${{ env.CF_BRANCH_NAME }} From 461cf91ffc63d6beb14086ae09e69fa59afe6810 Mon Sep 17 00:00:00 2001 From: "Bernard \"BeroBurny\" Stojanovic" Date: Tue, 10 Dec 2024 15:12:00 +0700 Subject: [PATCH 2/3] Revert "chore: refactor cf pages ci/cd from `gopher-*`to `sprinter-*`" This reverts commit 83b007320ba38986d853f9c05d28fc3819d08f91. --- .github/workflows/cd.yml | 15 ++++----------- .github/workflows/ci.yml | 28 ++++++++++++---------------- 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c2fd108..4222c40 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -49,18 +49,11 @@ jobs: - name: Publish Docs to Cloudflare Pages if: ${{ steps.release.outputs.releases_created }} - uses: cloudflare/wrangler-action@v3 + uses: cloudflare/pages-action@v1 with: - gitHubToken: ${{ secrets.GITHUB_TOKEN }} apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: 2238a825c5aca59233eab1f221f7aefb - command: pages deploy ./docs/build --project-name=sprinter-docs - - - name: Publish POC to Cloudflare Pages - if: ${{ steps.release.outputs.releases_created }} - uses: cloudflare/wrangler-action@v3 - with: + projectName: gopher-docs-preview + directory: ./docs/build gitHubToken: ${{ secrets.GITHUB_TOKEN }} - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: 2238a825c5aca59233eab1f221f7aefb - command: pages deploy ./web/.svelte-kit/cloudflare --project-name=sprinter-poc + branch: ${{ github.head_ref || github.ref_name }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0318b92..399e3b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,25 +29,21 @@ jobs: run: 'yarn run test:unit' - name: "Integrations Tests" run: 'yarn run test:integrations' - - name: Set branch name for Cloudflare Pages - id: cf-branch - run: | - if [[ "${{ github.ref_name }}" == "master" ]]; then - echo "CF_BRANCH_NAME=preview" >> $GITHUB_ENV - else - echo "CF_BRANCH_NAME=${{ github.head_ref || github.ref_name }}" >> $GITHUB_ENV - fi - - name: Publish Docs to Cloudflare Pages - uses: cloudflare/wrangler-action@v3 + - name: Publish POC to Cloudflare Pages + uses: cloudflare/pages-action@v1 with: - gitHubToken: ${{ secrets.GITHUB_TOKEN }} apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: 2238a825c5aca59233eab1f221f7aefb - command: pages deploy ./docs/build --project-name=sprinter-docs --branch=${{ env.CF_BRANCH_NAME }} - - name: Publish POC to Cloudflare Pages - uses: cloudflare/wrangler-action@v3 - with: + projectName: gopher-poc + directory: ./web/.svelte-kit/cloudflare gitHubToken: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.head_ref || github.ref_name }} + - name: Publish Preview Docs to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: 2238a825c5aca59233eab1f221f7aefb - command: pages deploy ./web/.svelte-kit/cloudflare --project-name=sprinter-poc --branch=${{ env.CF_BRANCH_NAME }} + projectName: gopher-docs-preview + directory: ./docs/build + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.head_ref || github.ref_name }} \ No newline at end of file From ebbab0d7963e1a61a0a52fb57cd7f2df5c67e01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernard=20Stojanovi=C4=87?= Date: Tue, 10 Dec 2024 10:10:29 +0100 Subject: [PATCH 3/3] chore: set docs to docs only mode (#98) --- docs/docs/01-introduction/01-introduction.md | 1 + docs/docusaurus.config.ts | 14 +++++--------- docs/src/pages/{index.tsx => _index.tsx} | 0 docs/src/pages/markdown-page.md | 7 ------- 4 files changed, 6 insertions(+), 16 deletions(-) rename docs/src/pages/{index.tsx => _index.tsx} (100%) delete mode 100644 docs/src/pages/markdown-page.md diff --git a/docs/docs/01-introduction/01-introduction.md b/docs/docs/01-introduction/01-introduction.md index 00e0820..bbd6bc7 100644 --- a/docs/docs/01-introduction/01-introduction.md +++ b/docs/docs/01-introduction/01-introduction.md @@ -1,5 +1,6 @@ --- id: intro +slug: / title: What Is Sprinter? sidebar_position: 1 --- diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index d8a099a..dbea7d8 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -26,6 +26,7 @@ const config: Config = { "classic", { docs: { + routeBasePath: '/', remarkPlugins: [ [require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }], ], @@ -51,18 +52,13 @@ const config: Config = { srcDark: "img/sprinter-logo-white.svg", }, items: [ - { - to: "docs/quickstart", - position: "left", - label: "Learn", - }, { href: "https://poc.sprinter.buildwithsygma.com/", label: "POC", position: "left", }, { - href: "https://api.test.sprinter.buildwithsygma.com/swagger/index.html", + href: "https://api.sprinter.buildwithsygma.com/swagger/index.html", label: "Swagger", position: "right", }, @@ -81,15 +77,15 @@ const config: Config = { items: [ { label: "Introduction", - to: "/docs/introduction", + to: "/", }, { label: "SDK", - to: "/docs/sdk", + to: "/sdk", }, { label: "React SDK", - to: "/docs/react-sdk/", + to: "/react-sdk/", }, ], }, diff --git a/docs/src/pages/index.tsx b/docs/src/pages/_index.tsx similarity index 100% rename from docs/src/pages/index.tsx rename to docs/src/pages/_index.tsx diff --git a/docs/src/pages/markdown-page.md b/docs/src/pages/markdown-page.md deleted file mode 100644 index 9756c5b..0000000 --- a/docs/src/pages/markdown-page.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Markdown page example ---- - -# Markdown page example - -You don't need React to write simple standalone pages.