From 47a1b1d3ac002406312572eb419fdd84dda356bb Mon Sep 17 00:00:00 2001 From: zman Date: Mon, 7 Apr 2025 11:52:35 -0400 Subject: [PATCH] actions? --- .gitea/workflows/deploy.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..07bb498 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,34 @@ +version: '1.0' + +actions: + - name: Checkout Repository + image: alpine:latest + commands: + # Install git and clone the repository + - apk add --no-cache git + - git clone https://your-gitea-repository-url.git /app + + - name: Build Docker Image + image: docker:latest + volumes: + - /var/run/docker.sock:/var/run/docker.sock # Mount Docker socket to interact with the host Docker daemon + commands: + # Navigate into the app directory and build the Docker image + - cd /app + - docker build -t giga_tcg . # Build your Docker image + + - name: Stop and Remove Existing Container (if exists) + image: docker:latest + volumes: + - /var/run/docker.sock:/var/run/docker.sock # Mount Docker socket + commands: + # Stop and remove any existing container with the same name + - docker rm -f giga_tcg_container || true # If the container doesn't exist, continue without error + + - name: Run New Docker Container + image: docker:latest + volumes: + - /var/run/docker.sock:/var/run/docker.sock # Mount Docker socket + commands: + # Run the newly built Docker container in detached mode, exposing port 8000 + - docker run -d -p 8000:8000 --name giga_tcg_container giga_tcg