Setup CI/CD dan Docker Compose
This commit is contained in:
parent
3323a3e37e
commit
30df8bbcf7
|
|
@ -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
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue