gitea/.gitea/workflows/gitea_deploy.yml
Pasha 08905c9e9b
Some checks failed
Deploy Gitea Custom / build-and-deploy (push) Failing after 36s
upd
2025-08-24 18:34:26 +03:00

51 lines
1.4 KiB
YAML

name: Deploy Gitea Custom
run-name: ${{ gitea.actor }} build image and deploy
on:
push:
branches:
- deploy_custom
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: Build Docker image
run: |
docker build \
--build-arg GITEA_VERSION=1.24.5 \
-t gitea-custom:latest .
- name: Stop and remove existing container
run: |
docker stop gitea-custom || true
docker rm gitea-custom || true
- name: Run new container
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 \
-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 \
--restart unless-stopped \
gitea-custom:latest
- name: Verify container is running
run: |
docker ps -a
docker logs gitea-custom --tail 50