first
Some checks failed
Build and Deploy Scheduler / cleaning (push) Successful in 1s
Build and Deploy Scheduler / build_image (push) Successful in 1m18s
Build and Deploy Scheduler / deploy (push) Failing after 0s

This commit is contained in:
teddys48
2026-02-12 11:23:48 +07:00
parent 56cd2dde79
commit bee0edbc52
3 changed files with 58 additions and 14 deletions

44
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,44 @@
name: Build and Deploy Scheduler
on:
push:
branches:
- main
env:
REGISTRY: localhost:9999
IMAGE_NAME: ${{ secrets.PROJECT_NAME }}
jobs:
cleaning:
runs-on: host
steps:
- name: Cleanup docker
run: |
docker container prune -f
docker image prune -af
build_image:
runs-on: host
needs: cleaning
steps:
- name: Clone repo
run: |
git clone ${{ gitea.server_url }}/${{ gitea.repository }} .
git checkout ${{ gitea.ref_name }}
- name: Build image
run: |
docker build -t $REGISTRY/$IMAGE_NAME:${{ gitea.run_number }} .
- name: Push image
run: |
docker push $REGISTRY/$IMAGE_NAME:${{ gitea.run_number }}
deploy:
runs-on: host
needs: build_image
steps:
- name: Deploy stack
run: |
docker compose up -d