From 49b636a46a5a91cc677caea5a427dbffb132321d Mon Sep 17 00:00:00 2001 From: Tsotne Gvadzabia Date: Wed, 21 Feb 2024 19:13:02 +0000 Subject: [PATCH] finish test workflow --- .github/workflows/docs.yml | 31 ++++++------------------------- .github/workflows/release.yml | 3 ++- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4e7cdfb..fcf409d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -31,28 +31,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Detect package manager - id: detect-package-manager - run: | - if [ -f "${{ github.workspace }}/yarn.lock" ]; then - echo "manager=yarn" >> $GITHUB_OUTPUT - echo "command=install" >> $GITHUB_OUTPUT - echo "runner=yarn" >> $GITHUB_OUTPUT - exit 0 - elif [ -f "${{ github.workspace }}/package.json" ]; then - echo "manager=npm" >> $GITHUB_OUTPUT - echo "command=ci" >> $GITHUB_OUTPUT - echo "runner=npx --no-install" >> $GITHUB_OUTPUT - exit 0 - else - echo "Unable to determine package manager" - exit 1 - fi - name: Setup Node uses: actions/setup-node@v4 with: node-version: "20" - cache: ${{ steps.detect-package-manager.outputs.manager }} + cache: npm - name: Setup Pages uses: actions/configure-pages@v4 with: @@ -65,22 +48,20 @@ jobs: uses: actions/cache@v4 with: path: | - .next/cache + ./apps/docs/.next/cache # Generate a new cache whenever packages or source files change. - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} # If source files changed but packages didn't, rebuild from a prior cache. restore-keys: | - ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- - name: Install dependencies run: npm ci - - name: Build with Next.js + - name: Build with Next.js for Export run: npm run docs:build - - name: Static HTML export with Next.js - run: ${{ steps.detect-package-manager.outputs.runner }} next export - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: ./out + path: ./apps/docs/out # Deployment job deploy: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index caa8f8e..eb7969c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: "20" + cache: npm - run: npm ci - name: Download production artifacts uses: actions/download-artifact@v4