-
Notifications
You must be signed in to change notification settings - Fork 482
50 lines (40 loc) · 1.25 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Build & Deploy
on:
push:
branches: [main]
workflow_dispatch:
env:
VUE_APP_IP_API_KEY: ${{ vars.VUE_APP_IP_API_KEY }}
jobs:
deploy:
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Yarn Install
run: yarn install
- name: ENV_VARS
run: echo "VUE_APP_IP_API_KEY=$VUE_APP_IP_API_KEY" >> .env
- name: Docker Build & tag
run: |
yarn docker:build
yarn docker:tag
- name: Configure doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Login to doctl registry
run: doctl registry login -t ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Docker Deploy
run: yarn docker:push
- name: Pull new image and restart
uses: appleboy/[email protected]
with:
host: ${{secrets.SSH_DEPLOY_HOST}}
key: ${{secrets.SSH_DEPLOY_KEY}}
username: ${{secrets.SSH_DEPLOY_USERNAME}}
script: |
docker pull registry.digitalocean.com/sandwich-farm/nostr-relay-status:latest
docker-compose stop
docker-compose up -d