ci: simplify workflows - deploy on main push, CI on PR only
Some checks failed
Deploy / deploy (push) Failing after 1s
Some checks failed
Deploy / deploy (push) Failing after 1s
This commit is contained in:
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@@ -1,15 +1,12 @@
|
|||||||
name: CI - Build and Lint
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [main, develop]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -20,12 +17,5 @@ jobs:
|
|||||||
- name: Generate Prisma client
|
- name: Generate Prisma client
|
||||||
run: npx prisma generate
|
run: npx prisma generate
|
||||||
|
|
||||||
- name: Lint
|
|
||||||
run: npm run lint --if-present || true
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Verify build output
|
|
||||||
run: |
|
|
||||||
[ -d dist ] && echo "✅ Build OK" || (echo "❌ dist not found" && exit 1)
|
|
||||||
|
|||||||
11
.github/workflows/deploy.yml
vendored
11
.github/workflows/deploy.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Deploy API-Ubigeo
|
name: Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -7,14 +7,13 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Copy source to server
|
- name: Sync source
|
||||||
run: |
|
run: |
|
||||||
rsync -av --delete \
|
rsync -a --delete \
|
||||||
--exclude='.git' \
|
--exclude='.git' \
|
||||||
--exclude='node_modules' \
|
--exclude='node_modules' \
|
||||||
--exclude='dist' \
|
--exclude='dist' \
|
||||||
@@ -25,6 +24,4 @@ jobs:
|
|||||||
run: bash /home/deployer/deploy-ubigeo.sh
|
run: bash /home/deployer/deploy-ubigeo.sh
|
||||||
|
|
||||||
- name: Health check
|
- name: Health check
|
||||||
run: |
|
run: curl -f https://api-ubigeo.darkcodex.dev/api/v1/health
|
||||||
sleep 10
|
|
||||||
curl -f https://api-ubigeo.darkcodex.dev/api/v1/health || exit 1
|
|
||||||
|
|||||||
Reference in New Issue
Block a user