From 0650c1a98428f110aed7ab247c42d1b940a21883 Mon Sep 17 00:00:00 2001 From: pasha1coil Date: Tue, 26 Aug 2025 09:22:48 +0300 Subject: [PATCH] optimize gitea_deploy --- .gitea/workflows/gitea_deploy.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/gitea_deploy.yml b/.gitea/workflows/gitea_deploy.yml index 6e9123c5c..c73524aa5 100644 --- a/.gitea/workflows/gitea_deploy.yml +++ b/.gitea/workflows/gitea_deploy.yml @@ -7,10 +7,8 @@ on: - deploy_custom env: - GITEA_VERSION: deploy_custom CONTAINER_NAME: gitea-production VOLUME_NAME: gitea_data - CONTAINER_HOST: unix:///run/user/1000/podman/podman.sock jobs: build-and-deploy: @@ -23,19 +21,12 @@ jobs: - name: Build container image run: | podman build \ - --build-arg GITEA_VERSION=${{ env.GITEA_VERSION }} \ - -t gitea-custom:${{ github.sha }} . - - - name: Stop existing container - run: | - podman stop ${{ env.CONTAINER_NAME }} || true - - - name: Backup current container (optional) - run: | - podman commit ${{ env.CONTAINER_NAME }} gitea-backup:$(date +%Y%m%d_%H%M%S) || true + --build-arg GITEA_VERSION=${{ github.ref_name }} \ + -t gitea-custom:${{ github.ref_name }} . - name: Remove old container run: | + podman stop ${{ env.CONTAINER_NAME }} || true podman rm ${{ env.CONTAINER_NAME }} || true - name: Run new container with data persistence @@ -53,7 +44,7 @@ jobs: -p 3001:3000 \ -p 2223:22 \ --restart unless-stopped \ - localhost/gitea-custom:${{ github.sha }} + localhost/gitea-custom::${{ github.ref_name }} #jobs: # build-and-deploy: