This commit is contained in:
parent
2ab5e8b19e
commit
2a53dff66f
@ -1,5 +1,5 @@
|
||||
name: Deploy Gitea Custom
|
||||
run-name: ${{ gitea.actor }} build image and push to container registry
|
||||
run-name: ${{ gitea.actor }} build image and deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -8,15 +8,23 @@ on:
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: [ubuntu-latest] #
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build image with podman
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
podman build -t gitea-custom:latest .
|
||||
docker build -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:
|
||||
@ -24,12 +32,8 @@ jobs:
|
||||
DB_USER: ${{ secrets.GITEA_DB_USER }}
|
||||
DB_PASS: ${{ secrets.GITEA_DB_PASS }}
|
||||
DB_NAME: ${{ secrets.GITEA_DB_NAME }}
|
||||
#todo mb more args
|
||||
run: |
|
||||
podman stop gitea-custom || true
|
||||
podman rm gitea-custom || true
|
||||
|
||||
podman run -d --name gitea-custom \
|
||||
docker run -d --name gitea-custom \
|
||||
-e GITEA__database__DB_TYPE=postgres \
|
||||
-e GITEA__database__HOST=$DB_HOST \
|
||||
-e GITEA__database__NAME=$DB_NAME \
|
||||
@ -38,3 +42,8 @@ jobs:
|
||||
-p 3001:3000 \
|
||||
--restart unless-stopped \
|
||||
gitea-custom:latest
|
||||
|
||||
- name: Verify container is running
|
||||
run: |
|
||||
docker ps -a
|
||||
docker logs gitea-custom --tail 50
|
||||
Loading…
Reference in New Issue
Block a user