From 30df8bbcf7b82c2a4815f3f7674ddae34bf71b76 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 7 Jan 2026 06:49:24 +0000 Subject: [PATCH] Setup CI/CD dan Docker Compose --- .github/workflows/deploy.yml | 26 ++++++++++++++++++++++++++ docker-compose.yml | 13 +++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/deploy.yml create mode 100644 docker-compose.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..97d3b8d --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,26 @@ +name: Deploy Docker Compose + +on: + push: + branches: [ "master" ] + +jobs: + deploy: + runs-on: self-hosted + + steps: + - name: Ambil Kodingan Terbaru + uses: actions/checkout@v4 + + - name: Buat File .env dari Rahasia + run: | + echo "${{ secrets.ENV_FILE }}" > .env + + - name: Deploy dengan Docker Compose + run: | + docker compose down + docker compose up -d --build --remove-orphans + + - name: Bersihkan Sampah Image + run: | + docker image prune -f \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8ebf122 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.8' + +services: + app: + container_name: flodo-container + build: . + restart: unless-stopped + ports: + - "8081:80" + extra_hosts: + - "host.docker.internal:host-gateway" + env_file: + - .env \ No newline at end of file