Skip to content

Commit

Permalink
ci: update workflow file (#15)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kevinanielsen authored Dec 17, 2023
1 parent 1592f2f commit 3144476
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
38 changes: 27 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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/" },
],
},
],
Expand Down
8 changes: 4 additions & 4 deletions docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,10 +26,10 @@ import { Card, CardGrid } from "@astrojs/starlight/components";
Github](https://github.com/kevinanielsen/go-fast-cdn/releases).
</Card>
<Card title="Read the docs" icon="open-book">
Go read the usage guide in [the docs](/guides/usage).
Go read the usage guide in [the docs](/go-fast-cdn/guides/usage).
</Card>
<Card title="Host your own CDN" icon="rocket">
[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.
</Card>
</CardGrid>

0 comments on commit 3144476

Please sign in to comment.