YUGABYTE_DEPLOYMENT #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: YUGABYTE_DEPLOYMENT | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Add Host to Known Hosts | |
run: | | |
ssh-keyscan -H ${{ secrets.HOST }} >> ~/.ssh/known_hosts | |
- name: Deploy yugabyte db | |
run: | | |
ssh -o StrictHostKeyChecking=no ${{ secrets.USER }}@${{ secrets.HOST }} << 'EOF' | |
# Deploy yugabyte container with the ACL file | |
docker pull yugabytedb/yugabyte:latest | |
sudo docker stop yugabyte-db || true && sudo docker rm yugabyte-db || true && | |
docker run -d --name yugabyte-db \ | |
-p7000:7000 -p9000:9000 -p15433:15433 -p5433:5433 -p9042:9042 \ | |
-v ~/yb_data:/home/yugabyte/yb_data \ | |
-e YB_PASSWORD=${{vars.YUGABYTE_PASSWORD}} \ | |
yugabytedb/yugabyte:latest bin/yugabyted start \ | |
--base_dir=/home/yugabyte/yb_data \ | |
--background=false --ysql_enable_auth=true | |
EOF |