Skip to content

Deploy to production #13

Deploy to production

Deploy to production #13

Workflow file for this run

name: Deploy to production
on:
push:
branches:
- master
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