You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/shared/docs-server-lifecycle.md
+20-9Lines changed: 20 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,17 +17,18 @@
17
17
Navigate to the docs directory and start the development server in the background, binding to all network interfaces on a fixed port:
18
18
19
19
```bash
20
+
mkdir -p /tmp/gh-aw
20
21
cd docs
21
-
nohup npm run dev -- --host 0.0.0.0 --port 4321 > /tmp/preview.log 2>&1&
22
+
nohup npm run dev -- --host 0.0.0.0 --port 4321 > /tmp/gh-aw/preview.log 2>&1&
22
23
PID=$!
23
-
echo$PID> /tmp/server.pid
24
+
echo$PID> /tmp/gh-aw/server.pid
24
25
echo"Server PID: $PID"
25
26
```
26
27
27
28
This will:
28
29
- Start the Astro development server on port 4321, bound to all interfaces (`0.0.0.0`)
29
-
- Redirect output to `/tmp/preview.log`
30
-
- Save the process ID to `/tmp/server.pid` for later cleanup
30
+
- Redirect output to `/tmp/gh-aw/preview.log`
31
+
- Save the process ID to `/tmp/gh-aw/server.pid` for later cleanup
31
32
32
33
**Note on the `nohup ... & PID=$!` pattern:** The `$!` variable (background PID) is captured into `PID` first, then written to file. Avoid `echo $! > file` in a single line — the AWF bash guard may flag `$!` as a dangerous expansion when it appears directly in a redirection context.
33
34
@@ -51,16 +52,26 @@ The agent runs inside a Docker container. Binding to `0.0.0.0` ensures the serve
51
52
Poll the server with curl until the `/gh-aw/` path returns HTTP 200:
0 commit comments