Skip to content

Merge pull request #23 from t1nyb0x/develop #2

Merge pull request #23 from t1nyb0x/develop

Merge pull request #23 from t1nyb0x/develop #2

Workflow file for this run

name: deploy
on:
push:
branches:
- main
workflow_run:
workflows: [release]
branches: [main]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- name: Restart Application
env:
SSH_USER: ${{ secrets.SSH_USER }}
VPS_HOST: ${{ secrets.VPS_HOST }}
SSH_PORT: ${{ secrets.SSH_PORT }}
ENV: ${{ secrets.ENVIRONMENT }}
TOKEN: ${{ secrets.PRODUCTION_TOKEN }}
run: |
ssh -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key $SSH_USER@$VPS_HOST -p $SSH_PORT \
'export ENVIRONMENT=ENV && export PRODUCTION_TOKEN=TOKEN \
docker pull ghcr.io/t1nyb0x/discord-twitter-embed-rx && \
docker run --env ENVIRONMENT --env PRODUCTION_TOKEN ghcr.io/t1nyb0x/discord-twitter-embed-rx'