Skip to content

Commit

Permalink
chore: fix pnpm setup in gh
Browse files Browse the repository at this point in the history
Signed-off-by: Rajiv Ranjan Singh <[email protected]>
  • Loading branch information
iamrajiv committed Aug 22, 2024
1 parent b86e000 commit dfd13bb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 22 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,33 @@ on:
push:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# For more customization options, review the GitHub Actions documentation:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
node-version: 18
cache: pnpm
version: 9

- name: Install dependencies
- name: Set Up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build website
run: pnpm build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
Expand All @@ -34,17 +41,16 @@ jobs:
name: Deploy to GitHub Pages
needs: build

# 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
pages: write # Required to deploy to Pages
id-token: write # Required to verify the deployment source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/test-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
name: Test deployment
name: Test Deployment

on:
pull_request:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# For more customization options, review the GitHub Actions documentation:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
test-deploy:
name: Test deployment
name: Test Deployment
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Set Up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install dependencies
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Test build website
run: pnpm build

0 comments on commit dfd13bb

Please sign in to comment.