Skip to content

Commit 4ce42a0

Browse files
committed
FIx again the CI/CD
1 parent 07d7d1d commit 4ce42a0

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ jobs:
6868
--exclude ".github/" \
6969
--exclude ".venv/" \
7070
--exclude "CosmoView/node_modules/" \
71+
--exclude "CosmoView/.local/" \
7172
--exclude "logs/" \
73+
--include "CosmoView/dist/***" \
7274
./ "${{ env.EC2_USER }}@${{ env.EC2_HOST }}:${TEMP_DIR}/"
7375
7476
# Move from temp to final location with sudo

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,20 @@ pipeline performs the following steps:
8282

8383
1. Checks out the latest code.
8484
2. Installs Node.js dependencies for the CosmoView frontend and builds the production bundle.
85-
3. Copies the repository to `/opt/nasa-sky-explorer` on your EC2 instance via `rsync` (skipping
86-
local build artefacts such as `node_modules/`).
85+
3. Copies the repository to `/opt/nasa-sky-explorer` on your EC2 instance via `rsync`, including
86+
the built `CosmoView/dist/public` assets (but excluding local build artefacts like
87+
`node_modules/`).
8788
4. Creates a dedicated service user (`nasaapp`) if it doesn't exist.
8889
5. Sets proper ownership and permissions for the application directory.
8990
6. Installs Python dependencies in a virtual environment owned by the service user.
90-
7. Installs CosmoView dependencies on the EC2 host and rebuilds the Vite bundle (or reuses the
91-
synced `CosmoView/dist/public` assets if the source directory is absent).
91+
7. Validates that the frontend assets were synced successfully (no rebuild on the server needed if
92+
Node.js isn't available).
9293
8. Applies necessary capabilities to bind to port 80 (if running on a privileged port).
9394
9. Restarts the systemd service or launches Uvicorn as a background process.
9495

95-
> **Prerequisite:** Ensure Node.js (v20 or newer recommended) is available on the EC2 instance so
96-
> the deployment script can run `npm install` and `npm run build` inside `CosmoView/`.
96+
> **Note:** Node.js is **not required** on the EC2 instance since the frontend is built by the
97+
> GitHub Actions runner and synced as a prebuilt bundle. You only need Node.js on the server if you
98+
> plan to rebuild the frontend manually after deployment.
9799
98100
### Required GitHub secrets
99101

0 commit comments

Comments
 (0)