Setup CI/CD dan Docker Compose

This commit is contained in:
root 2026-01-07 06:49:24 +00:00
parent 3323a3e37e
commit 30df8bbcf7
2 changed files with 39 additions and 0 deletions

26
.github/workflows/deploy.yml vendored Normal file
View File

@ -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

13
docker-compose.yml Normal file
View File

@ -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