Compare commits
4 Commits
8b5c52dd1e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ef643645a | |||
| 552379b2a6 | |||
| f9864072cf | |||
| 51341c33ca |
@@ -20,11 +20,17 @@ jobs:
|
|||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Setup required tools
|
- name: Setup required tools
|
||||||
run: sudo apt-get install zip jq curl -y
|
run: sudo apt-get install zip jq curl -y
|
||||||
|
|
||||||
- name: Install JS dependencies
|
- name: Install JS dependencies
|
||||||
run: npm install
|
run: npm ci
|
||||||
|
|
||||||
- name: Run build
|
- name: Run build
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Set up required tools
|
- name: Set up required tools
|
||||||
run: sudo apt-get install zip wget -y
|
run: sudo apt-get install zip wget -y
|
||||||
@@ -64,6 +65,7 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Set up required tools
|
- name: Set up required tools
|
||||||
run: sudo apt-get install unzip -y
|
run: sudo apt-get install unzip -y
|
||||||
@@ -95,6 +97,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: pr-screenshots
|
name: pr-screenshots
|
||||||
|
retention-days: 30
|
||||||
path: |
|
path: |
|
||||||
screenshots/home.png
|
screenshots/home.png
|
||||||
screenshots/editing.png
|
screenshots/editing.png
|
||||||
|
|||||||
@@ -29,21 +29,19 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
VERSION="${RELEASE_TAG#v}"
|
VERSION="${RELEASE_TAG#v}"
|
||||||
MATCHING_FILES=$(git grep -Il -e '\bv0\.0\.0\b' -e '\b0\.0\.0\b' || true)
|
sed -i -e "s/\"version\": \"0\.0\.0\"/\"version\": \"$VERSION\"/" manifest.json
|
||||||
if [ -n "$MATCHING_FILES" ]; then
|
|
||||||
while IFS= read -r file; do
|
- name: Set up Node.js
|
||||||
sed -i \
|
uses: actions/setup-node@v4
|
||||||
-e "s/\\bv0\\.0\\.0\\b/$RELEASE_TAG/g" \
|
with:
|
||||||
-e "s/\\b0\\.0\\.0\\b/$VERSION/g" \
|
node-version: 22
|
||||||
"$file"
|
cache: 'npm'
|
||||||
done <<< "$MATCHING_FILES"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Setup required tools
|
- name: Setup required tools
|
||||||
run: sudo apt-get install zip jq curl -y
|
run: sudo apt-get install zip jq curl -y
|
||||||
|
|
||||||
- name: Install JS dependencies
|
- name: Install JS dependencies
|
||||||
run: npm install
|
run: npm ci
|
||||||
|
|
||||||
- name: Run build
|
- name: Run build
|
||||||
run: |
|
run: |
|
||||||
@@ -148,15 +146,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
VERSION="${RELEASE_TAG#v}"
|
VERSION="${RELEASE_TAG#v}"
|
||||||
MATCHING_FILES=$(git grep -Il -e '\bv0\.0\.0\b' -e '\b0\.0\.0\b' || true)
|
sed -i -e "s/\"version\": \"0\.0\.0\"/\"version\": \"$VERSION\"/" manifest.json
|
||||||
if [ -n "$MATCHING_FILES" ]; then
|
|
||||||
while IFS= read -r file; do
|
|
||||||
sed -i \
|
|
||||||
-e "s/\\bv0\\.0\\.0\\b/$RELEASE_TAG/g" \
|
|
||||||
-e "s/\\b0\\.0\\.0\\b/$VERSION/g" \
|
|
||||||
"$file"
|
|
||||||
done <<< "$MATCHING_FILES"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Log in to Container Registry
|
- name: Log in to Container Registry
|
||||||
run: |
|
run: |
|
||||||
@@ -206,6 +196,7 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install JS dependencies
|
- name: Install JS dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
@@ -222,6 +213,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: release-screenshots
|
name: release-screenshots
|
||||||
|
retention-days: 30
|
||||||
path: |
|
path: |
|
||||||
screenshots/home.png
|
screenshots/home.png
|
||||||
screenshots/editing.png
|
screenshots/editing.png
|
||||||
|
|||||||
@@ -212,9 +212,9 @@ Build, then combine `dist/` + `manifest.json` into a folder and "Load unpacked"
|
|||||||
`Dockerfile` builds in Node 22 Alpine (`npm ci` → runs `scripts/prepare_release.sh` → `npm run build`) and serves `/app/dist` + `manifest.json` via nginx:alpine on port 80.
|
`Dockerfile` builds in Node 22 Alpine (`npm ci` → runs `scripts/prepare_release.sh` → `npm run build`) and serves `/app/dist` + `manifest.json` via nginx:alpine on port 80.
|
||||||
|
|
||||||
### CI/CD (Gitea Actions)
|
### CI/CD (Gitea Actions)
|
||||||
- `release.yaml` validates each `vX.Y.Z` tag and replaces tracked `v0.0.0`/`0.0.0` placeholders in each build checkout before producing the extension archive and production image.
|
- `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.
|
- **`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, and attaches them as individual Gitea release assets.
|
- 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`.
|
- **`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-<tag>.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.
|
- **`release.yaml`** — Triggers on `v*` tags. Builds, zips `dist/` + `manifest.json` as `vision-start-<tag>.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.
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 609 KiB After Width: | Height: | Size: 479 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 1.6 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 1.6 MiB |
Reference in New Issue
Block a user