deploy #7
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: deploy | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: [release] | |
branches: [main] | |
types: | |
- completed | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
known_hosts: ${{ secrets.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 $SSH_USER@$VPS_HOST -p $SSH_PORT \ | |
'export ENVIRONMENT=$ENV && export PRODUCTION_TOKEN=$TOKEN && \ | |
docker pull ghcr.io/t1nyb0x/discord-twitter-embed-rx:latest && \ | |
docker run --env ENVIRONMENT --env PRODUCTION_TOKEN ghcr.io/t1nyb0x/discord-twitter-embed-rx:latest' |