diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml index e29714b73..4909a7abe 100644 --- a/.github/workflows/bot.yml +++ b/.github/workflows/bot.yml @@ -35,3 +35,26 @@ jobs: file: ./Dockerfile.bot cache-from: type=gha,scope=$GITHUB_REF_NAME-bot cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-bot + + deploy: + runs-on: ubuntu-latest + needs: [test] + defaults: + run: + working-directory: ./server + if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + steps: + - name: Enable SSH Key + run: | + mkdir -p ~/.ssh + echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + sudo chmod 600 ~/.ssh/id_rsa + echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + env: + SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}} + SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}} + + - name: Deploy updates + run: ssh ci@"$TACHI_HOST" /home/ci/tachi-devops/scripts/deploy_bot.sh + env: + TACHI_HOST: ${{secrets.TACHI_HOST}} \ No newline at end of file diff --git a/.github/workflows/github-bot.yml b/.github/workflows/github-bot.yml index 8672ed9be..9c280f72e 100644 --- a/.github/workflows/github-bot.yml +++ b/.github/workflows/github-bot.yml @@ -37,3 +37,26 @@ jobs: - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} + + deploy: + runs-on: ubuntu-latest + needs: [test] + defaults: + run: + working-directory: ./server + if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + steps: + - name: Enable SSH Key + run: | + mkdir -p ~/.ssh + echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + sudo chmod 600 ~/.ssh/id_rsa + echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + env: + SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}} + SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}} + + - name: Deploy updates + run: ssh ci@"$TACHI_HOST" /home/ci/tachi-devops/scripts/deploy_bot.sh + env: + TACHI_HOST: ${{secrets.TACHI_HOST}} diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index dfd1a42ba..048a2357c 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -91,3 +91,26 @@ jobs: - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} + + deploy: + runs-on: ubuntu-latest + needs: [test] + defaults: + run: + working-directory: ./server + if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + steps: + - name: Enable SSH Key + run: | + mkdir -p ~/.ssh + echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + sudo chmod 600 ~/.ssh/id_rsa + echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + env: + SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}} + SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}} + + - name: Deploy updates + run: ssh ci@"$TACHI_HOST" /home/ci/tachi-devops/scripts/deploy_server.sh + env: + TACHI_HOST: ${{secrets.TACHI_HOST}} \ No newline at end of file