Skip to content

Commit

Permalink
Create build-test.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
narmidm authored Jul 2, 2024
1 parent 8bfeac5 commit b1f3bbd
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-test.yaml
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

0 comments on commit b1f3bbd

Please sign in to comment.