-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (35 loc) · 898 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
34
35
36
name: Deploy to Server
on:
push:
paths-ignore:
- '.gitignore'
branches:
- 'main'
workflow_dispatch: {}
jobs:
build-and-deploy:
runs-on: ['self-hosted']
environment: api-server
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- uses: actions/cache@v3
with:
path: |
~/.bun/install/cache
node_modules/
key: ${{ runner.os }}-cargo
- run: bun install
- run: bun run build-only
- name: Setup SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Deploy
run: scp -i ~/.ssh/id_rsa -r dist/* ${{ env.SERVER }}:/var/www/s3-browser