-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.02 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
name: Deploy to production
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Install WireGuard
run: |
sudo apt update
sudo apt install -y wireguard openresolv
- name: Setup WireGuard
run: |
echo "${{ secrets.VPN_CONF }}" | base64 -d > /tmp/wg0.conf
sudo mv /tmp/wg0.conf /etc/wireguard/wg0.conf
sudo wg-quick up wg0
- name: Deploy file
run: |
echo "${{ secrets.SSH_PRIVATE_KEY }}" | base64 -d > /tmp/id_rsa
chmod 600 /tmp/id_rsa
scp -i /tmp/id_rsa -o StrictHostKeyChecking=no -r ./dist/* [email protected]:/var/www/html
- name: Disconnect WireGuard
run: sudo wg-quick down wg0