add environment for production

This commit is contained in:
wayanrivan
2025-05-16 09:37:10 +07:00
parent 5b837d8cc2
commit d9ddbd596e
5 changed files with 105 additions and 0 deletions

46
.woodpecker.yml Normal file
View File

@ -0,0 +1,46 @@
steps:
- name: setup
image: node:22-alpine
commands:
- apk update && apk add git
- npm i typescript -g
- npm install
- echo '✅ success setup project'
when:
branch:
- main
- name: build-swagger
image: node:22-alpine
environment:
NODE_ENV: prod
commands:
- npm run swagger
when:
branch:
- main
- name: build-src
image: node:22-alpine
environment:
NODE_ENV: prod
commands:
- npm i typescript -g
- npm run build:production
- echo '✅ success compile typescript and ready to deploy'
when:
branch:
- main
- name: deploy
image: docker
commands:
- docker builder prune -f
- docker container prune -f
- docker-compose build
- docker-compose up -d --no-deps --build --remove-orphans
volumes:
- /var/run/docker.sock:/var/run/docker.sock
when:
branch:
- main