optimize gitea_deploy
Some checks failed
Deploy Gitea Custom / build-and-deploy (push) Failing after 14m27s
Some checks failed
Deploy Gitea Custom / build-and-deploy (push) Failing after 14m27s
This commit is contained in:
parent
4ec7102537
commit
0650c1a984
@ -7,10 +7,8 @@ on:
|
|||||||
- deploy_custom
|
- deploy_custom
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GITEA_VERSION: deploy_custom
|
|
||||||
CONTAINER_NAME: gitea-production
|
CONTAINER_NAME: gitea-production
|
||||||
VOLUME_NAME: gitea_data
|
VOLUME_NAME: gitea_data
|
||||||
CONTAINER_HOST: unix:///run/user/1000/podman/podman.sock
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
@ -23,19 +21,12 @@ jobs:
|
|||||||
- name: Build container image
|
- name: Build container image
|
||||||
run: |
|
run: |
|
||||||
podman build \
|
podman build \
|
||||||
--build-arg GITEA_VERSION=${{ env.GITEA_VERSION }} \
|
--build-arg GITEA_VERSION=${{ github.ref_name }} \
|
||||||
-t gitea-custom:${{ github.sha }} .
|
-t gitea-custom:${{ github.ref_name }} .
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
||||||
- name: Remove old container
|
- name: Remove old container
|
||||||
run: |
|
run: |
|
||||||
|
podman stop ${{ env.CONTAINER_NAME }} || true
|
||||||
podman rm ${{ env.CONTAINER_NAME }} || true
|
podman rm ${{ env.CONTAINER_NAME }} || true
|
||||||
|
|
||||||
- name: Run new container with data persistence
|
- name: Run new container with data persistence
|
||||||
@ -53,7 +44,7 @@ jobs:
|
|||||||
-p 3001:3000 \
|
-p 3001:3000 \
|
||||||
-p 2223:22 \
|
-p 2223:22 \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
localhost/gitea-custom:${{ github.sha }}
|
localhost/gitea-custom::${{ github.ref_name }}
|
||||||
|
|
||||||
#jobs:
|
#jobs:
|
||||||
# build-and-deploy:
|
# build-and-deploy:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user