-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (28 loc) · 1.03 KB
/
domcloud.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
name: Build to DOM Cloud
on:
push:
branches:
- main
workflow_dispatch:
env:
APP_BINARY_PATH: target/release/todo
SERVER_DESTINATION: [email protected]:./public_html
jobs:
copy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Rust
uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v1
- name: Build release binary
run: cargo build --release --locked
- name: Copy to Remote Server
run: >-
# Install the SSH identifier from action secrets
mkdir -p $HOME/.ssh; (echo "${{ secrets.SSH_KEY }}" > $HOME/.ssh/id_rsa); chmod 0600 $HOME/.ssh/id_rsa;
# Copy app binary to server
scp -o StrictHostKeyChecking=no -i $HOME/.ssh/id_rsa ${{ env.APP_BINARY_PATH }} ${{ env.SERVER_DESTINATION }};
# Also copy static files also needed by the binaries
scp -o StrictHostKeyChecking=no -i $HOME/.ssh/id_rsa -r db static migrations Rocket.toml ${{ env.SERVER_DESTINATION }};