Add a CI GitHub action for templates #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- project: create-convex | ||
- project: template-astro | ||
- project: template-bare | ||
- project: template-component | ||
- project: template-component/example | ||
- project: template-nextjs | ||
deploy_key: ${{ secrets.GENERATE_TEMPLATE_NEXTJS_DEPLOY_KEY }} | ||
Check failure on line 23 in .github/workflows/ci.yml
|
||
- project: template-nextjs-clerk | ||
deploy_key: ${{ secrets.GENERATE_TEMPLATE_NEXTJS_DEPLOY_KEY }} | ||
- project: template-nextjs-clerk-shadcn | ||
- project: template-nextjs-convexauth | ||
deploy_key: ${{ secrets.GENERATE_TEMPLATE_NEXTJS_DEPLOY_KEY }} | ||
- project: template-nextjs-convexauth-shadcn | ||
deploy_key: ${{ secrets.GENERATE_TEMPLATE_NEXTJS_DEPLOY_KEY }} | ||
- project: template-nextjs-lucia-shadcn | ||
- project: template-nextjs-shadcn | ||
deploy_key: ${{ secrets.GENERATE_TEMPLATE_NEXTJS_DEPLOY_KEY }} | ||
- project: template-react-vite | ||
deploy_key: ${{ secrets.GENERATE_TEMPLATE_REACT_VITE_DEPLOY_KEY }} | ||
- project: template-react-vite-clerk | ||
deploy_key: ${{ secrets.GENERATE_TEMPLATE_REACT_VITE_DEPLOY_KEY }} | ||
- project: template-react-vite-clerk-shadcn | ||
- project: template-react-vite-convexauth | ||
deploy_key: ${{ secrets.GENERATE_TEMPLATE_REACT_VITE_DEPLOY_KEY }} | ||
- project: template-react-vite-convexauth-shadcn | ||
deploy_key: ${{ secrets.GENERATE_TEMPLATE_REACT_VITE_DEPLOY_KEY }} | ||
- project: template-react-vite-shadcn | ||
deploy_key: ${{ secrets.GENERATE_TEMPLATE_REACT_VITE_DEPLOY_KEY }} | ||
- project: template-tanstack-start | ||
- project: template-tanstack-start-clerk | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
ssh-key: ${{ matrix.deploy_key || '' }} | ||
token: ${{ matrix.deploy_key && '' || secrets.GITHUB_TOKEN }} | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
cache: "npm" | ||
cache-dependency-path: "${{ matrix.project }}/package-lock.json" | ||
- name: Install dependencies | ||
working-directory: ${{ matrix.project }} | ||
run: npm ci | ||
- name: Build parent component (if example project) | ||
if: matrix.project == 'template-component/example' | ||
working-directory: template-component | ||
run: | | ||
npm ci | ||
npm run build | ||
- name: Build project | ||
working-directory: ${{ matrix.project }} | ||
run: npm run build | ||
- name: Run typecheck (if available) | ||
working-directory: ${{ matrix.project }} | ||
run: | | ||
if npm run | grep -q "typecheck"; then | ||
npm run typecheck | ||
else | ||
echo "No typecheck script found, skipping" | ||
fi | ||
- name: Run lint (if available) | ||
working-directory: ${{ matrix.project }} | ||
run: | | ||
if npm run | grep -q "lint"; then | ||
npm run lint | ||
else | ||
echo "No lint script found, skipping" | ||
fi |