ทดสอบ CI/CD
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Flook 2025-01-31 10:10:20 +07:00
parent dd2aef016c
commit 26c0cf6c28
3 changed files with 34 additions and 6 deletions

View File

@ -1,3 +1,4 @@
node_modules node_modules
dist dist
.git .git
.env

View File

@ -1,9 +1,36 @@
kind: pipeline kind: pipeline
type: docker type: docker
name: test-pipeline name: default
steps: steps:
- name: say-hello - name: Install dependencies
image: alpine image: node:18-alpine
commands: commands:
- echo "Hello from Drone CI!" - npm ci
- name: Build
image: node:18-alpine
commands:
- npm run build
- name: Build Docker Image
image: docker:latest
environment:
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
commands:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t adminsoftwarecraft/opengis:latest .
- docker push adminsoftwarecraft/opengis:latest
- name: Deploy to Server
image: curlimages/curl:latest
environment:
WEBHOOK_URL:
from_secret: WEBHOOK_URL
WEBHOOK_SECRET:
from_secret: WEBHOOK_SECRET
commands:
- 'curl -X POST "$WEBHOOK_URL" -H "Authorization: Bearer $WEBHOOK_SECRET"'

View File

@ -2,7 +2,7 @@ function App() {
return ( return (
<div className="flex flex-col items-center justify-center min-h-screen py-2"> <div className="flex flex-col items-center justify-center min-h-screen py-2">
<h1 className="text-3xl font-bold underline text-center">สวสด! การ Deploy ตโนมสำเร</h1> <h1 className="text-3xl font-bold underline text-center">สวสด! CI/CD ตโนมสำเร</h1>
</div> </div>
) )
} }