Skip to content

Commit 64a37e1

Browse files
authored
fix(ci): docusaurus test checks (#28)
Signed-off-by: Lucas Amaral <[email protected]>
1 parent 7e0752e commit 64a37e1

File tree

3 files changed

+34
-14
lines changed

3 files changed

+34
-14
lines changed

.github/workflows/docs-test.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,30 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- uses: actions/checkout@v4
30-
- uses: actions/setup-node@v4
31-
with:
32-
node-version: '18'
33-
34-
- name: Install dependencies
30+
- name: Build docusaurus container
3531
run: |
3632
cd docusaurus/
37-
yarn install --frozen-lockfile
38-
39-
- name: Build and test Docusaurus
33+
docker compose -f docker-compose.yml build dev
34+
- name: Start docusaurus container
4035
run: |
4136
cd docusaurus/
42-
yarn test
43-
44-
- name: Verify build output
37+
docker compose -f docker-compose.yml up -d dev
38+
- name: Wait for docusaurus to start
4539
run: |
46-
cd docusaurus/
47-
test -d build && echo "✅ Build successful"
40+
echo "Waiting for Docusaurus to start..."
41+
sleep 60
42+
- name: Check running containers
43+
run: |
44+
echo "Checking running containers..."
45+
docker ps -a
46+
- name: Check Docusaurus logs
47+
run: |
48+
echo "Checking Docusaurus logs..."
49+
docker logs docusaurus_local
50+
- name: Check Docusaurus health
51+
run: |
52+
echo "Checking Docusaurus health..."
53+
curl -f http://localhost:3000 > /dev/null || exit 1
4854
4955
markdown-lint:
5056
name: Markdown Format Check

docusaurus/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,23 @@ FROM node:22-slim AS base
2020
ENV FORCE_COLOR=0
2121
RUN corepack enable
2222
WORKDIR /opt/docusaurus
23+
24+
# Documentation contents
25+
# The docs directory is overwritten by compose file
26+
COPY docs docs
27+
COPY src src
28+
COPY static static
29+
COPY versioned_docs versioned_docs
30+
COPY versioned_sidebars versioned_sidebars
31+
32+
# Configuration files
33+
COPY docusaurus.config.js .
2334
COPY package.json .
2435
COPY package-lock.json* .
36+
COPY sidebars.js .
37+
COPY sidebars.json .
38+
COPY test.js .
39+
COPY versions.json .
2540

2641
#==================================================================
2742
# Local deployment

docusaurus/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ services:
1010
ports:
1111
- "3000:3000"
1212
volumes:
13-
- .:/opt/docusaurus
1413
- ./../readmes:/opt/docusaurus/docs
1514
environment:
1615
- NODE_ENV=development

0 commit comments

Comments
 (0)