Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/curaz/curaz-api-server into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
changminkim-329 committed Jun 20, 2024
2 parents e50ddff + 5dfc869 commit 5c61db0
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 3 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/curaz-cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CURAZ CI/CD Pipeline

on:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "::add-path::${HOME}/.local/bin"
- name: Install dependencies
run: poetry install

- name: Export requirements.txt
run: poetry export -f requirements.txt --output requirements.txt

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build Docker image
run: docker build -t curaz/api-server:latest .

- name: Push Docker image
run: docker push curaz/api-server:latest

deploy:
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Deploy to server
uses: appleboy/ssh-action@v0.1.3
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_PASSWORD }}
password: ${{ secrets.SERVER_REMOTE_USER }}
script: |
cd /path/to/your/docker-compose-directory
docker-compose pull
docker-compose up -d
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
__pycache__
requirements.txt
poetry.lock
.python-version
.python-version
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10.8
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "curaz-api-server"
version = "0.1.0"
description = ""
description = "BOAZ API SERVER"
authors = ["Changmin Kim <ckd29672@naver.com>"]
readme = "README.md"

Expand All @@ -13,4 +13,3 @@ fastapi = "^0.111.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 5c61db0

Please sign in to comment.