Skip to content

Commit 75c8c6c

Browse files
author
Dheeraj TILHOO
committed
Setup GitHub Pages deploy for docs
1 parent d52b20b commit 75c8c6c

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main # or master, if that’s your default branch
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
cache: "npm"
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Generate static site (Nuxt/Docus)
32+
env:
33+
# VERY IMPORTANT for GitHub Pages: base path = /<repo-name>/
34+
NUXT_APP_BASE_URL: /laravel-rest-api-flutter-doc/
35+
NITRO_PRESET: github-pages
36+
run: npx nuxi generate
37+
38+
- name: Upload GitHub Pages artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: .output/public
42+
43+
deploy:
44+
runs-on: ubuntu-latest
45+
needs: build
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
50+
steps:
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)