Skip to content

Commit

Permalink
Update docs.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomano authored Dec 12, 2024
1 parent 41d1dcd commit 1407354
Showing 1 changed file with 13 additions and 46 deletions.
59 changes: 13 additions & 46 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,42 @@
# .github/workflows/docs.yml

name: GitHub Pages
name: Deploy Docs to GitHub Pages

on:
workflow_dispatch:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branch’s name
push:
branches: [main]
paths:
- '.github/workflows/docs.yml'
- 'docs/**'
workflow_dispatch:

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout your repository using git
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Setup Pages
uses: actions/configure-pages@v4
with:
static_site_generator: next
- name: Restore cache
uses: actions/cache@v4
- name: Install, build, and upload your site
uses: withastro/action@v3
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install dependencies
run: |
cd docs
pnpm install
- name: Build site with Next.js
run: |
cd docs
pnpm build
touch out/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out
path: ./docs
# node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (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)

# Deployment job
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down

0 comments on commit 1407354

Please sign in to comment.