From d7bcf44fdf9a642d5c24a4c27c2368e0a384851f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=85=B8=EA=B2=BD=EB=AF=BC?= <72291860+gengminy@users.noreply.github.com> Date: Mon, 8 Aug 2022 12:41:24 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20feat(deploy):=20main=EC=97=90=20?= =?UTF-8?q?=EC=BB=A4=EB=B0=8B=20=EC=8B=9C=20=EA=B9=83=ED=97=99=EC=95=A1?= =?UTF-8?q?=EC=85=98=EC=9C=BC=EB=A1=9C=20=EB=8F=84=EC=BB=A4=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=ED=91=B8=EC=8B=9C=20#25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ev-deploy.yml => docker-image-publish.yml} | 70 ++++++++++--------- 1 file changed, 37 insertions(+), 33 deletions(-) rename .github/workflows/{dev-deploy.yml => docker-image-publish.yml} (62%) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/docker-image-publish.yml similarity index 62% rename from .github/workflows/dev-deploy.yml rename to .github/workflows/docker-image-publish.yml index 00ed872..8a329b9 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/docker-image-publish.yml @@ -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 @@ -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