测试 CICD
Some checks failed
TDevOPsCICD / lint-and-test (18.x) (push) Has been cancelled
TDevOPsCICD / lint-and-test (20.x) (push) Has been cancelled
TDevOPsCICD / build-image (push) Has been cancelled

This commit is contained in:
Cheney 2025-04-16 15:34:09 +08:00
parent c2119665fd
commit 60c1e61f73
2 changed files with 34 additions and 0 deletions

34
.gitea/workflows/ci.yaml Normal file
View File

@ -0,0 +1,34 @@
name: TDevOPsCICD
on: [push]
jobs:
lint-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm test
env:
NODE_ENV: test
build-image:
runs-on: ubuntu-latest
needs: lint-and-test
steps:
- uses: actions/checkout@v4
- name: Build Docker Image
run: |
docker build -t my-registry.com/my-node-app:${{ github.sha }} .
docker push my-registry.com/my-node-app:${{ github.sha }}
env:
DOCKER_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}

View File