Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7 Изменение main(backend) и backend пайплайнов #44

Merged
merged 2 commits into from
Dec 10, 2024
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
8 changes: 1 addition & 7 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java CI
name: Backend CI

on:
pull_request:
Expand Down Expand Up @@ -33,12 +33,6 @@ jobs:
cd backend
mvn clean verify

- name: Upload backend build artifact
uses: actions/upload-artifact@v4
with:
name: backend-jar
path: /backend/target/*.jar

- name: Cache SonarQube packages
uses: actions/cache@v4
with:
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Main CD
name: CI/CD remote

on:
pull_request:
Expand All @@ -16,6 +16,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

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

Expand All @@ -25,19 +31,18 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Download Backend Artifact
uses: actions/download-artifact@v4
with:
name: backend-jar
path: backend/target/
- name: Build backend
run: |
cd backend
mvn clean package

- name: Build and Push Backend Image
- name: Build and push backend image
run: |
cd backend
docker build -t nickpominov/lm-backend:latest .
docker push nickpominov/lm-backend:latest

- name: Deploy Backend to Remote Server
- name: Deploy backend to remote server
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
Expand All @@ -46,6 +51,7 @@ jobs:
port: 22
script: |
cd /srv/lenka-messenger
docker-compose -f docker-compose.prod.yaml pull lm-backend
docker-compose -f docker-compose.prod.yaml up -d --no-deps lm-backend

cd-frontend:
Expand Down Expand Up @@ -95,4 +101,5 @@ jobs:
port: 22
script: |
cd /srv/lenka-messenger
docker-compose -f docker-compose.prod.yaml pull lm-frontend
docker-compose -f docker-compose.prod.yaml up -d --no-deps lm-frontend
Loading