-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build and Serve Docusaurus Website | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-serve: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js 20.14 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '20.14' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build website | ||
run: npm run build | ||
|
||
- name: Start Docusaurus server | ||
run: npm run serve -- --host 0.0.0.0 | ||
|
||
- name: Wait for Docusaurus to start | ||
run: sleep 5 # Adjust as needed based on your server startup time | ||
|
||
- name: Test Docusaurus website | ||
run: | | ||
curl -IsS http://localhost:3000 | head -n 1 | grep "200 OK" | ||
- name: Shutdown Docusaurus server | ||
run: npm run clear # Replace with your shutdown command if needed |