Files
kulakpos_web/.gitea/workflows/pipeline.yml
eko eca25818b9
All checks were successful
Build, Push and Deploy / build-and-deploy (push) Successful in 3m15s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
fix exit container
2026-03-28 19:30:40 +07:00

51 lines
1.6 KiB
YAML

name: Build, Push and Deploy
on:
push:
branches: [ main, master ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Gitea Registry
uses: docker/login-action@v3
with:
registry: kode.sadateknologi.site
username: ${{ gitea.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
# Build with the FIXED Dockerfile that includes composer install
- name: Build and push fixed image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
kode.sadateknologi.site/yanto/kulakpos_web:latest
kode.sadateknologi.site/yanto/kulakpos_web:${{ gitea.sha }}
# Deploy the fixed image
- name: Deploy
run: |
docker stop kulakpos_web || true
docker rm kulakpos_web || true
docker pull kode.sadateknologi.site/yanto/kulakpos_web:latest
docker run -d \
--restart unless-stopped \
--health-cmd="curl -f http://localhost:8000 || exit 1" \
--health-interval=30s \
--health-timeout=10s \
--health-retries=3 \
--name kulakpos_web \
--network="host" \
-v /home/act_runner/.env_kulakpos:/var/www/html/.env \
-p 8000:8000 \
-e MODE=dev \
-e APP_ENV=local \
kode.sadateknologi.site/yanto/kulakpos_web:latest