From 70d0d6745eeccc4b0ce34d131dd3488827ebe34b Mon Sep 17 00:00:00 2001 From: Alejandra Quetzalli Date: Wed, 15 Jun 2022 01:11:27 -0700 Subject: [PATCH] ci: updating spec urls to match new Information Architecture in website (#801) --- .github/scripts/remove-toc.js | 4 ++-- .github/workflows/new-spec-release.yml | 10 +++++----- .github/workflows/update-spec.yaml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/scripts/remove-toc.js b/.github/scripts/remove-toc.js index b1305b21..29adb588 100644 --- a/.github/scripts/remove-toc.js +++ b/.github/scripts/remove-toc.js @@ -9,7 +9,7 @@ module.exports = (givenSpec) => { const startingLine = "## Table of Contents\n"; const endingLine = "\n"; - const specFile = fs.readFileSync(`./website/pages/docs/specifications/${givenSpec}.md`); + const specFile = fs.readFileSync(`./website/pages/docs/reference/specification/${givenSpec}.md`); const startingIndex = specFile.indexOf(startingLine); const endingIndex = specFile.indexOf(endingLine); @@ -21,5 +21,5 @@ module.exports = (givenSpec) => { const firstHalf = specFile.slice(0, startingIndex); const secondHalf = specFile.slice(endingIndex + endingLine.length); const specWithoutToc = `${firstHalf}${secondHalf}`; - fs.writeFileSync(`./website/pages/docs/specifications/${givenSpec}.md`, specWithoutToc); + fs.writeFileSync(`./website/pages/docs/reference/specification/${givenSpec}.md`, specWithoutToc); } diff --git a/.github/workflows/new-spec-release.yml b/.github/workflows/new-spec-release.yml index 8eef2276..eadf1fda 100644 --- a/.github/workflows/new-spec-release.yml +++ b/.github/workflows/new-spec-release.yml @@ -38,20 +38,20 @@ jobs: script: | const fs = require("fs"); - const specFiles = fs.readdirSync("./website/pages/docs/specifications"); + const specFiles = fs.readdirSync("./website/pages/docs/reference/specification"); const nextRelease = `${{github.event.release.tag_name}}`; const prefixRelease = nextRelease.split("-")[0]; for (const filename of specFiles) { if (filename.startsWith(prefixRelease)) { - fs.unlinkSync(`./website/pages/docs/specifications/${filename}`); + fs.unlinkSync(`./website/pages/docs/reference/specification/${filename}`); } } - name: Copy Spec file from Current Repo to Another working-directory: ./website run: | - cp ../spec/spec/asyncapi.md ./pages/docs/specifications/${{github.event.release.tag_name}}.md + cp ../spec/spec/asyncapi.md ./pages/docs/reference/specification/${{github.event.release.tag_name}}.md - name: Remove Table of Contents from Spec uses: actions/github-script@v4 with: @@ -71,7 +71,7 @@ jobs: const endingLine = "# LATEST-SPEC-REDIRECTION:END"; const releaseVersion = `${{github.event.release.tag_name}}`; - const redirectLine = `/docs/specifications/latest /docs/specifications/${releaseVersion} 302!\n`; + const redirectLine = `/docs/reference/specification/latest /docs/reference/specification/${releaseVersion} 302!\n`; const redirectFile = fs.readFileSync("./website/public/_redirects", "utf-8"); @@ -139,7 +139,7 @@ jobs: const releaseVersionWithoutV = releaseVersion.slice(1); - const redirectLine = `/docs/specifications/${releaseVersionWithoutV} /docs/specifications/${releaseVersion} 302!\n`; + const redirectLine = `/docs/reference/specification/${releaseVersionWithoutV} /docs/reference/specification/${releaseVersion} 302!\n`; const redirectFile = fs.readFileSync("./website/public/_redirects", "utf-8"); diff --git a/.github/workflows/update-spec.yaml b/.github/workflows/update-spec.yaml index 0dfa85ed..528a66e5 100644 --- a/.github/workflows/update-spec.yaml +++ b/.github/workflows/update-spec.yaml @@ -41,7 +41,7 @@ jobs: - name: Copy Spec file from Current Repo to Another working-directory: ./website run: | - cp ../spec/spec/asyncapi.md ./pages/docs/specifications/${{ steps.latest_version.outputs.latest_tag }}.md + cp ../spec/spec/asyncapi.md ./pages/docs/reference/specification/${{ steps.latest_version.outputs.latest_tag }}.md - name: Remove Table of Contents from Spec uses: actions/github-script@v4 with: