diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml index 497cce2..f63e9bd 100644 --- a/.gitea/workflows/main.yaml +++ b/.gitea/workflows/main.yaml @@ -20,11 +20,17 @@ jobs: - name: Check out repository code uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + - name: Setup required tools run: sudo apt-get install zip jq curl -y - name: Install JS dependencies - run: npm install + run: npm ci - name: Run build run: | diff --git a/.gitea/workflows/pull-request.yaml b/.gitea/workflows/pull-request.yaml index 3260250..b61ef88 100644 --- a/.gitea/workflows/pull-request.yaml +++ b/.gitea/workflows/pull-request.yaml @@ -22,6 +22,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 + cache: 'npm' - name: Set up required tools run: sudo apt-get install zip wget -y @@ -64,6 +65,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 + cache: 'npm' - name: Set up required tools run: sudo apt-get install unzip -y @@ -95,6 +97,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: pr-screenshots + retention-days: 30 path: | screenshots/home.png screenshots/editing.png diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 929b59f..6ac8f96 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -31,11 +31,17 @@ jobs: VERSION="${RELEASE_TAG#v}" sed -i -e "s/\"version\": \"0\.0\.0\"/\"version\": \"$VERSION\"/" manifest.json + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + - name: Setup required tools run: sudo apt-get install zip jq curl -y - name: Install JS dependencies - run: npm install + run: npm ci - name: Run build run: | @@ -190,6 +196,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 + cache: 'npm' - name: Install JS dependencies run: npm ci @@ -206,6 +213,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: release-screenshots + retention-days: 30 path: | screenshots/home.png screenshots/editing.png diff --git a/project-context.md b/project-context.md index c2a0686..b443a23 100644 --- a/project-context.md +++ b/project-context.md @@ -213,8 +213,8 @@ Build, then combine `dist/` + `manifest.json` into a folder and "Load unpacked" ### CI/CD (Gitea Actions) - `release.yaml` validates each `vX.Y.Z` tag and stamps the version into `manifest.json` (`"version": "0.0.0"` → the tag) in each build checkout before producing the extension archive and production image. -- **`pull-request.yaml`** — Triggers on pull request open, reopen, and synchronization. It builds and uploads a PR extension archive containing `dist/`, unpacks that archive in a separate Playwright job to generate the three demo screenshots, and uploads both artifacts. For same-repository PRs, it maintains one Gitea PR comment with inline image attachments; fork PRs retain artifacts but skip the comment because their workflow token is read-only. -- After `deploy_vision_start` succeeds, `release.yaml` uses Playwright Chromium against the deployed production page and seeds each browser context from `scripts/demoData.json`. It regenerates `home.png`, `editing.png`, and `configuration.png` at exactly 1280×800, uploads them as artifacts, and attaches them as individual Gitea release assets. +- **`pull-request.yaml`** — Triggers on pull request open, reopen, and synchronization. It builds and uploads a PR extension archive containing `dist/`, unpacks that archive in a separate Playwright job to generate the three demo screenshots, and uploads both artifacts (screenshots are retained for 30 days). For same-repository PRs, it maintains one Gitea PR comment with inline image attachments; fork PRs retain artifacts but skip the comment because their workflow token is read-only. +- After `deploy_vision_start` succeeds, `release.yaml` uses Playwright Chromium against the deployed production page and seeds each browser context from `scripts/demoData.json`. It regenerates `home.png`, `editing.png`, and `configuration.png` at exactly 1280×800, uploads them as artifacts (retained for 30 days), and attaches them as individual Gitea release assets. - **`main.yaml`** — Triggers on push to `main` (and `workflow_dispatch`). Builds, pushes a `staging` multi-arch (amd64/arm64) image to `git.ivanch.me/ivanch/vision-start:staging`, then SSH-deploys on the staging host via `docker compose up -d --force-recreate`. - **`release.yaml`** — Triggers on `v*` tags. Builds, zips `dist/` + `manifest.json` as `vision-start-.zip`, runs `scripts/check_virustotal.sh` against it (publishes analysis URL + detection ratio on the release body), creates a Gitea release, pushes a `latest` multi-arch image, and SSH-deploys to production.