Skip to content

Commit

Permalink
fix: Add database connection variable to actions
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Drla <[email protected]>
  • Loading branch information
mimotej committed Jan 27, 2024
1 parent b0e0c5f commit dbc6b93
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/actions/deploy-app/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ runs:
GUILD_ID: ${{ inputs.GUILD_ID }}
SSH_KEY: ${{ inputs.SSH_KEY }}
KNOWN_HOSTS: ${{ inputs.KNOWN_HOSTS }}
DATABASE_CONNECTION_STRING: ${{ inputs.DATABASE_CONNECTION_STRING }}
shell: bash
run: |
echo "Log in to docker..."
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/restart-app/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ runs:
GUILD_ID: ${{ inputs.GUILD_ID }}
SSH_KEY: ${{ inputs.SSH_KEY }}
KNOWN_HOSTS: ${{ inputs.KNOWN_HOSTS }}
DATABASE_CONNECTION_STRING: ${{ inputs.DATABASE_CONNECTION_STRING }}
shell: bash
run: |
echo "Log in to docker..."
Expand All @@ -23,4 +24,4 @@ runs:
mkdir ~/.ssh
echo $KNOWN_HOSTS >> ~/.ssh/known_hosts
echo "Connect to VM and start app..."
ssh -i ~/vm_key.key $ADDRESS_VM "cd /app && " 'docker kill $(sudo docker ps -a -q); docker rm $(docker ps --filter status=exited -q);' "docker run -d -e DISCORD_TOKEN=$DISCORD_TOKEN -e CLIENT_ID=$CLIENT_ID -e GUILD_ID=$GUILD_ID -it --mount type=bind,source=/app/userLog.json,target=/root/userLog.json --mount type=bind,source=/app/config.json,target=/root/config.json mimotej/oqix:latest"
ssh -i ~/vm_key.key $ADDRESS_VM "cd /app && " 'docker kill $(sudo docker ps -a -q); docker rm $(docker ps --filter status=exited -q);' "docker run -d -e DISCORD_TOKEN=$DISCORD_TOKEN -e CLIENT_ID=$CLIENT_ID -e GUILD_ID=$GUILD_ID -e DATABASE_CONNECTION_STRING=$DATABASE_CONNECTION_STRING -it --mount type=bind,source=/app/userLog.json,target=/root/userLog.json --mount type=bind,source=/app/config.json,target=/root/config.json mimotej/oqix:latest"
1 change: 1 addition & 0 deletions .github/workflows/deploy-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ jobs:
GUILD_ID: ${{ secrets.GUILD_ID }}
SSH_KEY: ${{ secrets.SSH_KEY }}
KNOWN_HOSTS: ${{ secrets.KNOWN_HOSTS }}
DATABASE_CONNECTION_STRING: ${{ secrets.DATABASE_CONNECTION_STRING }}
1 change: 1 addition & 0 deletions .github/workflows/restart-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ jobs:
GUILD_ID: ${{ secrets.GUILD_ID }}
SSH_KEY: ${{ secrets.SSH_KEY }}
KNOWN_HOSTS: ${{ secrets.KNOWN_HOSTS }}
DATABASE_CONNECTION_STRING: ${{ secrets.DATABASE_CONNECTION_STRING }}

0 comments on commit dbc6b93

Please sign in to comment.