44 lines
1.3 KiB
YAML
44 lines
1.3 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 \
|
|
--name kulakpos_web \
|
|
-p 8000:8000 \
|
|
-e MODE=dev \
|
|
-e APP_ENV=local \
|
|
kode.sadateknologi.site/yanto/kulakpos_web:latest |