Skip to content

[chore] : backend, frontend, 개발 환경세팅 #1

[chore] : backend, frontend, 개발 환경세팅

[chore] : backend, frontend, 개발 환경세팅 #1

name: CI/CD Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Check out the repository code
- name: Check out repository
uses: actions/checkout@v3
# Set up Python environment
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
# Create and activate virtual environment, install dependencies
- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
# Build Docker image
- name: Build Docker image
run: |
docker build -t pig .
# Deploy Docker container
- name: Deploy Docker container
run: |
CONTAINER_ID=$(docker ps -q --filter ancestor=pig)
if [ -n "$CONTAINER_ID" ]; then
docker stop $CONTAINER_ID
docker rm $CONTAINER_ID
fi
docker run -d -p 8000:8000 pig