From dfd13bb501846913723082a6d85e29411e53970b Mon Sep 17 00:00:00 2001 From: Rajiv Ranjan Singh Date: Fri, 23 Aug 2024 04:17:07 +0530 Subject: [PATCH] chore: fix pnpm setup in gh Signed-off-by: Rajiv Ranjan Singh --- .github/workflows/deploy.yaml | 30 ++++++++++++++++++------------ .github/workflows/test-deploy.yaml | 27 +++++++++++++++++---------- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index f0055e5..cbb11f7 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -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 @@ -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 diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index da76095..a744234 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -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