-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.44 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: Deploy
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache Dart
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/dart-sdk
key: ${{ runner.os }}-dart-2.19.6
# https://dart.dev/get-dart/archive
- name: Install Dart SDK
uses: dart-lang/setup-dart@v1.3
with:
sdk: 2.19.6
- name: Build
run: |
dart pub get
dart compile exe bin/main.dart -o bin/main
- name: Upload file to file.io
id: upload-file
uses: heowc/action-file.io@0.2.0
with:
file_path: bin/main
file_basename: main
- name: Setup on remote server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.RPMTW_SERVER_SSH_HOST }}
username: ${{ secrets.RPMTW_SERVER_SSH_USERNAME }}
key: ${{ secrets.RPMTW_SERVER_SSH_KEY }}
passphrase: ${{ secrets.RPMTW_SERVER_SSH_PASSPHRASE }}
script: |
cd ./RPMTW-Server
sudo git restore .
sudo git pull
sudo docker-compose pull
sudo docker-compose build --build-arg EXEC_DOWNLOAD_URL=${{ fromJSON(steps.upload-file.outputs.response).link }} --build-arg USE_BINARY=true
sudo docker-compose down
sudo docker-compose up -d