Skip to content

Commit

Permalink
ci: enable deploys
Browse files Browse the repository at this point in the history
  • Loading branch information
zkrising committed Apr 6, 2024
1 parent 926141a commit 123a708
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
23 changes: 23 additions & 0 deletions .github/workflows/github-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
23 changes: 23 additions & 0 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

0 comments on commit 123a708

Please sign in to comment.