Files
rednote-tool-studio/.gitea/workflows/ci.yml
T
2026-09-18 21:58:13 +08:00

43 lines
1.2 KiB
YAML

name: CI
concurrency:
group: rednote-tool-studio-production
cancel-in-progress: false
on:
push:
branches: [main]
pull_request:
jobs:
verify:
runs-on: ubuntu-latest
container: node:24-bookworm-slim
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run typecheck
- name: Unit tests
run: npm test
- name: Production build
run: npm run build
- name: Stop the retired persistent container
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'
run: |
node --input-type=module <<'JS'
import Docker from "dockerode";
const docker = new Docker({ socketPath: "/var/run/docker.sock" });
for (const name of ["rednote-tool-studio", "rednote-tool-studio-candidate", "rednote-tool-studio-previous"]) {
try {
await docker.getContainer(name).remove({ force: true });
} catch (error) {
if (error.statusCode !== 404) throw error;
}
}
console.log("Retired Rednote Tool Studio containers stopped; the data volume was preserved.");
JS