-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (30 loc) · 1002 Bytes
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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'