32 lines
809 B
YAML
32 lines
809 B
YAML
# .gitea/workflows/deploy.yml
|
|
name: Deploy App to Docker
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # Trigger on push to the main branch
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu:latest # Use a fresh Ubuntu image to run the job
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2 # Checkout the repository's code to the runner
|
|
|
|
- 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 .
|
|
|
|
- name: Remove existing Docker container
|
|
run: |
|
|
docker rm -f giga_tcg_container || true
|
|
|
|
- name: Run Docker container
|
|
run: |
|
|
docker run -d -p 8000:8000 --name giga_tcg_container giga_tcg |