Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .github/workflows/ci.yml

This file was deleted.

88 changes: 88 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Realse Version

on:
push:
branches:
- master
- dev
paths:
- 'app/**'
- 'crawl/**'

jobs:
releaseGithub:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-22.04
permissions:
contents: write
pull-requests: write
steps:
- name: Bump version and push tag
id: bump
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch

- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
fromTag: ${{ steps.bump.outputs.previous_tag }}
toTag: ${{ steps.bump.outputs.new_tag }}

- name: Create Release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.bump.outputs.changelog }}
tag_name: ${{ steps.bump.outputs.new_tag }}

releaseDockerWithDeployment:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/devopsgpt-fastapi:${{ github.ref_name }}

- name: Deploying landing prod on the remote server
if: github.ref == 'refs/heads/master'
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.HOST_USERNAME }}
password: ${{ secrets.HOST_PASSWORD }}
port: ${{ secrets.HOST_PORT }}
script: docker compose -f devopsgpt-fastapi/docker-compose-fastapi.yml down fastapi_prod && docker compose -f devopsgpt-fastapi/docker-compose-fastapi.yml up -d --pull always fastapi_prod

- name: Deploying landing dev on the remote server
if: github.ref == 'refs/heads/dev'
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.HOST_USERNAME }}
password: ${{ secrets.HOST_PASSWORD }}
port: ${{ secrets.HOST_PORT }}
script: docker compose -f devopsgpt-fastapi/docker-compose-fastapi.yml down fastapi_dev && docker compose -f devopsgpt-fastapi/docker-compose-fastapi.yml up -d --pull always fastapi_dev

- name: Removing dangle images on the remote server
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.HOST_USERNAME }}
password: ${{ secrets.HOST_PASSWORD }}
port: ${{ secrets.HOST_PORT }}
script: docker image prune -f
5 changes: 0 additions & 5 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ jobs:
- name: install requirements
run: pip install -r requirements.txt

- name: docker login
uses: docker/login-action@v3
with:
username: 81318131
password: ${{ secrets.DOCKER_PASSWORD }}

- name: build services
run: docker compose build
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
namespace ?= default
releaseName ?= devopsgpt

all: build up
all: update-submodule build up

update-submodule:
git submodule init && git submodule update

build:
docker compose build
Expand Down
1 change: 1 addition & 0 deletions app/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def client():
return TestClient(app)



@pytest.fixture
def iac_template_docker_sample_input():
return IaCTemplateGenerationDocker().model_dump()
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
build:
context: .
dockerfile: Dockerfile
image: 81318131/fastapi_gpt
image: fastapi_gpt
container_name: fastapi_gpt
command: fastapi run app/main.py --port 8080
volumes:
Expand All @@ -24,7 +24,7 @@ services:
dockerfile: Dockerfile
args:
VITE_API_CLIENT_BASE_URL: "http://localhost:8080/api/"
image: 81318131/web_gpt
image: web_gpt
container_name: web_gpt
ports:
- "80:4173"
Expand Down
Loading