Skip to content

Commit

Permalink
feat: ci/cd added for production
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Emerald-Wolf committed Mar 14, 2024
1 parent d9d1761 commit 339d5f5
Showing 1 changed file with 32 additions and 49 deletions.
81 changes: 32 additions & 49 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,35 @@ on:
- master # Adjust the branch as needed

jobs:
deploy-to-server:
runs-on: ubuntu-latest
# needs: build-and-push

steps:
- name: SSH and Deploy
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}

port: 22
script: |
cd devsoc-backend-24/
git pull origin master
sudo -S docker compose down
sudo -S docker compose up -d --build
# build-and-push:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout repository
# uses: actions/checkout@v2

# - name: "Create env file"
# run: |
# echo "${{ secrets.ENV }}" > .env
# cat .env

# - name: Build Go backend Docker image
# run: |
# docker build -t shivam2002/bolt-backend:latest .
# env:
# DOCKER_BUILDKIT: 1 # Enable BuildKit for improved build performance

# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

# - name: Push Docker image to Docker Hub
# run: |
# docker push shivam2002/bolt-backend:latest
# env:
# DOCKER_BUILDKIT: 1 # Enable BuildKit for improved build performance


deploy-to-solar-guardian:
runs-on: ubuntu-latest
steps:
- name: SSH and Deploy
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
port: 22
script: |
cd devsoc-backend-24/
git pull origin master
sudo -S docker compose down
sudo -S docker compose up -d --build
deploy-to-midnight-sentinel:
runs-on: ubuntu-latest

steps:
- name: SSH and Deploy
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SERVER_HOST_2 }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD_2 }}
port: 22
script: |
cd devsoc-backend-24/
git pull origin master
sudo -S docker compose down
sudo -S docker compose up -d --build

0 comments on commit 339d5f5

Please sign in to comment.