Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/a0uda/Reddit-BE
Browse files Browse the repository at this point in the history
  • Loading branch information
a0uda committed Apr 2, 2024
2 parents 1b755c7 + 97f1839 commit d6405b2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 49 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
# # CD Backend

# name: CD BE

# on:
# push:
# branches:
# - main
# jobs:
# build_push_docker:
# name: Build Backend For Prod files and push to docker
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2

# - name: Build Backend For Prod files
# run: |
# docker build -t aoudaa/dkr-backend:latest .

# - name: Login to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}

# - name: Push Docker Backend image

# run: |
# docker push aoudaa/dkr-backend:latest

# deploy:
# name: Deploy Backend For Prod files
# runs-on: ubuntu-latest
# needs: build_push_docker

# steps:
# - name: ssh into vm and run the script
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.HOST }}
# username: ${{ secrets.USERNAME }}
# key: ${{ secrets.SSH_KEY }}
# script: |
# cd ~/docker
# sh deployBE.sh
# CD Backend

name: CD BE

on:
push:
branches:
- main
jobs:
build_push_docker:
name: Build Backend For Prod files and push to docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Build Backend For Prod files
run: |
docker build -t aoudaa/dkr-backend:latest .
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push Docker Backend image

run: |
docker push aoudaa/dkr-backend:latest
deploy:
name: Deploy Backend For Prod files
runs-on: ubuntu-latest
needs: build_push_docker

steps:
- name: ssh into vm and run the script
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
cd ~/docker
sh deployBE.sh
4 changes: 0 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
name: CI BE

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build_dev_test:
name: Build Backend For Dev files
Expand Down

0 comments on commit d6405b2

Please sign in to comment.