From 5ca7cf19475d805f3b308ac2795aee839027ff5d Mon Sep 17 00:00:00 2001 From: uwoobeat Date: Mon, 12 Feb 2024 01:09:01 +0900 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20deploy=20=EC=A0=84=EC=9A=A9=20?= =?UTF-8?q?=EC=9B=8C=ED=81=AC=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/develop_deploy.yml | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/develop_deploy.yml diff --git a/.github/workflows/develop_deploy.yml b/.github/workflows/develop_deploy.yml new file mode 100644 index 000000000..d5859fc8a --- /dev/null +++ b/.github/workflows/develop_deploy.yml @@ -0,0 +1,29 @@ +name: Deploy to Develop + +on: + workflow_dispatch: + inputs: + commit_hash: + description: 'commit_hash' + required: true + +jobs: + build: + runs-on: ubuntu-latest + environment: develop + steps: + - name: Deploy to EC2 Server + uses: appleboy/ssh-action@master + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_IMAGE_TAG: ${{ github.event.inputs.commit_hash }} + with: + host: ${{ secrets.EC2_HOST }} + username: ${{ secrets.EC2_USERNAME }} + key: ${{ secrets.EC2_PRIVATE_KEY }} + envs: DOCKERHUB_USERNAME,DOCKERHUB_IMAGE_TAG # docker-compose.yml 에서 사용할 환경 변수 + script: | + echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin + docker pull ${{ env.DOCKERHUB_USERNAME }}/gdsc-server:${{ env.DOCKERHUB_IMAGE_TAG }} + docker compose -f /home/ubuntu/docker-compose.yml up -d + docker image prune -a -f From 3e095bdbad309db6a03929aeab6763c92ecc68e1 Mon Sep 17 00:00:00 2001 From: uwoobeat Date: Mon, 12 Feb 2024 01:16:02 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EC=98=A4=ED=83=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/develop_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/develop_deploy.yml b/.github/workflows/develop_deploy.yml index d5859fc8a..395e9ecc0 100644 --- a/.github/workflows/develop_deploy.yml +++ b/.github/workflows/develop_deploy.yml @@ -8,7 +8,7 @@ on: required: true jobs: - build: + deploy: runs-on: ubuntu-latest environment: develop steps: