1.3 KiB
1.3 KiB
name, description, triggers
| name | description | triggers | |||
|---|---|---|---|---|---|
| CI Workflow Generator | Scaffolds a GitHub Actions workflow for install, lint, test, and build; optionally builds and pushes Docker images. |
|
CI Workflow Generator
Purpose
- Provide a reusable GitHub Actions workflow to run installs, linters, tests (Vitest), and build steps for a Vite app.
Example prompts
- "create .github/workflows/ci.yml to run tests and build"
- "add workflow to build and push Docker image"
Workflow outline
- Runs on push/pull_request
- Steps: checkout, cache node modules, install, run lint, run tests, run build
- Optional: on push to main build and push Docker image to registry (requires secrets)
Sample job YAML (high-level)
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: npm ci
- run: npm run lint --if-present
- run: npm run test --if-present
- run: npm run build
Notes
- Include caching for node modules (actions/cache) to speed up runs.
- If adding Docker publish, recommend using
docker/build-push-actionwithsecrets.DOCKERHUB_TOKENor GHCR.