From 0c78276b1258d8b617c2ce20822c40fdee0b97de Mon Sep 17 00:00:00 2001 From: zman Date: Mon, 7 Apr 2025 11:54:02 -0400 Subject: [PATCH] j --- .gitea/workflows/deploy.yaml | 58 +++++++++++++++++------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 07bb498..bf0d405 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -1,34 +1,32 @@ -version: '1.0' +# .gitea/workflows/deploy.yml +name: Deploy App to Docker -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 +on: + push: + branches: + - main # Trigger on push to the main branch - - 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 +jobs: + deploy: + runs-on: ubuntu:latest # Use a fresh Ubuntu image to run the job - - 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 + steps: + - name: Checkout code + uses: actions/checkout@v2 # Checkout the repository's code to the runner - - 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 + - name: Set up Docker + uses: docker/setup-buildx-action@v1 # Set up Docker Buildx, which is used for building images + with: + version: 'latest' + + - name: Build Docker Image + run: | + docker build -t giga_tcg . # Build the Docker image using the Dockerfile + + - name: Remove existing Docker container + run: | + docker rm -f giga_tcg_container || true # Remove any existing container with the name + + - name: Run Docker container + run: | + docker run -d -p 8000:8000 --name giga_tcg_container giga_tcg # Run the new container \ No newline at end of file