upd
Some checks failed
Deploy Gitea Custom / build-and-deploy (push) Failing after 3m54s

This commit is contained in:
Pasha 2025-08-24 21:26:53 +03:00
parent e2a4ee3630
commit 5e184cb75a

@ -1,11 +1,16 @@
name: Deploy Gitea Custom
run-name: ${{ gitea.actor }} build image and deploy
run-name: ${{ gitea.actor }} deploying Gitea
on:
push:
branches:
- deploy_custom
env:
GITEA_VERSION: deploy_custom
CONTAINER_NAME: gitea-production
VOLUME_NAME: gitea_data
jobs:
build-and-deploy:
runs-on: ubuntu-latest
@ -13,8 +18,6 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@ -23,35 +26,55 @@ jobs:
run: |
docker build \
--build-arg GITEA_VERSION=${{ env.GITEA_VERSION }} \
-t gitea-custom:${{ github.sha }} \
-t gitea-custom:latest .
- name: Stop and remove existing container
- name: Stop existing container
run: |
docker stop gitea-custom || true
docker rm gitea-custom || true
docker stop ${{ env.CONTAINER_NAME }} || true
- name: Run new container
- name: Backup current container (optional)
run: |
docker commit ${{ env.CONTAINER_NAME }} gitea-backup:$(date +%Y%m%d_%H%M%S) || true
- name: Remove old container
run: |
docker rm ${{ env.CONTAINER_NAME }} || true
- name: Run new container with data persistence
env:
DB_HOST: ${{ secrets.GITEA_DB_HOST }}
DB_USER: ${{ secrets.GITEA_DB_USER }}
DB_PASS: ${{ secrets.GITEA_DB_PASS }}
DB_NAME: ${{ secrets.GITEA_DB_NAME }}
run: |
docker run -d --name gitea-custom \
docker run -d --name ${{ env.CONTAINER_NAME }} \
-e GITEA__database__DB_TYPE=postgres \
-e GITEA__database__HOST=$DB_HOST \
-e GITEA__database__NAME=$DB_NAME \
-e GITEA__database__USER=$DB_USER \
-e GITEA__database__PASSWD=$DB_PASS \
-p 3001:3000 \
-e USER_UID=1000 \
-e USER_GID=1000 \
-v ${{ env.VOLUME_NAME }}:/data \
-p 3000:3000 \
-p 2222:22 \
--restart unless-stopped \
gitea-custom:latest
- name: Wait for Gitea to start
run: |
sleep 30
- name: Verify container is running
run: |
docker ps -a
docker logs gitea-custom --tail 50
docker logs ${{ env.CONTAINER_NAME }} --tail 20
docker inspect ${{ env.CONTAINER_NAME }} --format='{{.State.Status}}'
- name: Health check
run: |
curl -f http://localhost:3000/api/healthz || exit 1
# name: Deploy Gitea Custom