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