diff --git a/.dockerignore b/.dockerignore index f2e3d31..bf77ef1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ node_modules dist -.git \ No newline at end of file +.git +.env \ No newline at end of file diff --git a/.drone.yml b/.drone.yml index 265dced..9386c2f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,9 +1,36 @@ kind: pipeline type: docker -name: test-pipeline +name: default steps: - - name: say-hello - image: alpine + - name: Install dependencies + image: node:18-alpine commands: - - echo "Hello from Drone CI!" \ No newline at end of file + - 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"' diff --git a/src/App.jsx b/src/App.jsx index a6af01f..8726f20 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -2,7 +2,7 @@ function App() { return (
-

สวัสดี! การ Deploy อัตโนมัติสำเร็จ

+

สวัสดี! CI/CD อัตโนมัติสำเร็จ

) }