From fde4f0afd0dc32b89be3e7e597a898e259cdfa8a Mon Sep 17 00:00:00 2001 From: Rutaj Dash <33367546+rutajdash@users.noreply.github.com> Date: Fri, 17 Jun 2022 14:39:13 +0530 Subject: [PATCH] fix(cd-cd): deploy script --- .github/workflows/deploy.yml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b7d626dc..e7cc8da7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,20 +29,20 @@ jobs: name: Pull and Run Docker Container runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v2 +# - name: Checkout Repository +# uses: actions/checkout@v2 - - name: Add Env File - run: ${{ secrets.env_vars }} > client/env/.env.${{ inputs.node_env }} +# - name: Add Env File +# run: ${{ secrets.env_vars }} > client/env/.env.${{ inputs.node_env }} - - name: Copy Required Files - uses: appleboy/scp-action@v0.0.1 - with: - host: ${{ inputs.ssh_host }} - username: ${{ inputs.ssh_username }} - key: ${{ secrets.ssh_private_key }} - source: "docker-compose.yml,client/env/.env.${{ inputs.node_env }}" - target: "~/apps/project-tahiti" +# - name: Copy Required Files +# uses: appleboy/scp-action@v0.0.1 +# with: +# host: ${{ inputs.ssh_host }} +# username: ${{ inputs.ssh_username }} +# key: ${{ secrets.ssh_private_key }} +# source: "docker-compose.yml,client/env/.env.${{ inputs.node_env }}" +# target: "~/apps/project-tahiti" - name: Run SSH Commands uses: appleboy/ssh-action@v0.1.4 @@ -52,5 +52,7 @@ jobs: key: ${{ secrets.ssh_private_key }} script: | cd ~/apps/project-tahiti - docker pull ${{ inputs.registry }}/${{ inputs.image_name }}:${{ inputs.node_env }} - docker-compose up + docker pull ghcr.io/monday-morning/project-tahiti:production + docker-compose down + docker-compose up -d + docker image prune -a -f