From 31444764a698aa50bca40211d46ce3d817c7ce31 Mon Sep 17 00:00:00 2001 From: Kevin Nielsen Date: Sun, 17 Dec 2023 12:45:16 +0100 Subject: [PATCH] ci: update workflow file (#15) * ci: update workflow file * fix(ci): remove pnpm as package-manager * fix: add package-manager * ci: update deploy workflow * fix: pnpm setup * fix: pages artifact name * ci: fix astro base url --- .github/workflows/deploy.yml | 38 +++++++++++++++++++++++---------- docs/astro.config.mjs | 4 ++-- docs/src/content/docs/index.mdx | 8 +++---- 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f57092c..4981ed5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,9 @@ on: # Using a different branch name? Replace `main` with your branch’s name push: branches: [main] + pull_request: + branches: + - main # Allows you to run this workflow manually from the Actions tab on GitHub. workflow_dispatch: @@ -20,23 +23,36 @@ jobs: steps: - name: Checkout your repository using git uses: actions/checkout@v3 - - name: Install, build, and upload your site - uses: withastro/action@v1 + - name: Setup pnpm + uses: pnpm/action-setup@v2.4.0 with: - path: /docs - package-manager: pnpm@latest - # with: - # path: . # The root location of your Astro project inside the repository. (optional) - # node-version: 18 # The specific version of Node that should be used to build your site. Defaults to 18. (optional) - # package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) - + version: 8.x + - name: Install dependencies + run: cd docs && pnpm install + - name: Build + run: cd docs && pnpm build + - name: Upload artifacts + uses: actions/upload-pages-artifact@v2.0.0 + with: + path: docs/dist/ + deploy: + # Add a dependency to the build job needs: build - runs-on: ubuntu-latest + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} + + # Specify runner + deployment step + runs-on: ubuntu-latest steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v3 # or specific "vX.X.X" version tag for this action diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 34f786d..5a3c41d 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -16,8 +16,8 @@ export default defineConfig({ label: "Guides", items: [ // Each item here is one entry in the navigation menu. - { label: "Usage", link: "/guides/usage/" }, - { label: "Hosting", link: "/guides/hosting/" }, + { label: "Usage", link: "/go-fast-cdn/guides/usage/" }, + { label: "Hosting", link: "/go-fast-cdn/guides/hosting/" }, ], }, ], diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx index caf75f5..c8e58e4 100644 --- a/docs/src/content/docs/index.mdx +++ b/docs/src/content/docs/index.mdx @@ -8,7 +8,7 @@ hero: file: ../../assets/gopher.png actions: - text: How to use - link: /guides/usage/ + link: /go-fast-cdn/guides/usage/ icon: right-arrow variant: primary - text: Leave a star on Github @@ -26,10 +26,10 @@ import { Card, CardGrid } from "@astrojs/starlight/components"; Github](https://github.com/kevinanielsen/go-fast-cdn/releases). - Go read the usage guide in [the docs](/guides/usage). + Go read the usage guide in [the docs](/go-fast-cdn/guides/usage). - [Click here](/guides/hosting) to learn how to host your CDN for free in a - docker container. + [Click here](/go-fast-cdn/guides/hosting) to learn how to host your CDN for + free in a docker container.