ci: add Gitea Actions workflow for build, test, and release
- lint, typecheck, build on every push/PR - create release with static export zip on version tags
This commit is contained in:
64
.gitea/workflows/ci.yml
Normal file
64
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,64 @@
|
||||
name: Build & Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ["v*"]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Typecheck
|
||||
run: npm run typecheck
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Upload build artifact
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: resume-static
|
||||
path: out/
|
||||
|
||||
release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: resume-static
|
||||
path: out/
|
||||
|
||||
- name: Create release zip
|
||||
run: |
|
||||
cd out && zip -r ../resume-${GITHUB_REF_NAME}.zip .
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: resume-${GITHUB_REF_NAME}.zip
|
||||
generate_release_notes: true
|
||||
fail_on_unmatched_files: true
|
||||
Reference in New Issue
Block a user