Skip to content

Commit

Permalink
๐Ÿš€ feat(deploy): main์— ์ปค๋ฐ‹ ์‹œ ๊นƒํ—™์•ก์…˜์œผ๋กœ ๋„์ปค ์ด๋ฏธ์ง€ ํ‘ธ์‹œ #25
Browse files Browse the repository at this point in the history
  • Loading branch information
gengminy authored Aug 8, 2022
1 parent f272506 commit d7bcf44
Showing 1 changed file with 37 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Deploy to Dev Server
name: Push Image to DockerHub

on:
push:
branches:
- dev
branches: [main]
# Publish semver tags as releases.
tags: ['v*.*.*']

permissions:
contents: read
Expand Down Expand Up @@ -84,36 +85,39 @@ jobs:
platforms: linux/amd64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

#Create Remote Directory
- name: create remote directory
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_DEV }}
username: ${{ secrets.USERNAME }}
#password: ${{ secrets.PASSWORD }}
key: ${{ secrets.KEY_DEV }}
script: mkdir -p ~/srv/ubuntu/hifi_dev
# #Using Dev Server
#
# #Create Remote Directory
# - name: create remote directory
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.HOST_DEV }}
# username: ${{ secrets.USERNAME }}
# #password: ${{ secrets.PASSWORD }}
# key: ${{ secrets.KEY_DEV }}
# script: mkdir -p ~/srv/ubuntu/hifi_dev

#Copy Source
- name: copy source via ssh key
uses: burnett01/rsync-deployments@4.1
with:
switches: -avzr --delete
remote_path: ~/srv/ubuntu/
remote_host: ${{ secrets.HOST_DEV }}
remote_user: ${{ secrets.USERNAME }}
remote_key: ${{ secrets.KEY_DEV }}
# #Copy Source
# - name: copy source via ssh key
# uses: burnett01/rsync-deployments@4.1
# with:
# switches: -avzr --delete
# remote_path: ~/srv/ubuntu/
# remote_host: ${{ secrets.HOST_DEV }}
# remote_user: ${{ secrets.USERNAME }}
# remote_key: ${{ secrets.KEY_DEV }}

#Execute
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_DEV }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY_DEV }}
script: |
sh ~/srv/ubuntu/config/scripts/deploy.sh
sudo docker image prune -a
sudo docker-compose -f ~/srv/ubuntu/docker-compose.yml pull
sudo docker-compose -f ~/srv/ubuntu/docker-compose.yml up --build -d
# #Execute
# - name: executing remote ssh commands using password
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.HOST_DEV }}
# username: ${{ secrets.USERNAME }}
# key: ${{ secrets.KEY_DEV }}
# script: |
# sh ~/srv/ubuntu/config/scripts/deploy.sh
# sudo docker image prune -a
# sudo docker-compose -f ~/srv/ubuntu/docker-compose.yml pull
# sudo docker-compose -f ~/srv/ubuntu/docker-compose.yml up --build -d

0 comments on commit d7bcf44

Please sign in to comment.