-
Notifications
You must be signed in to change notification settings - Fork 5
36 lines (31 loc) · 934 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: Web Deployment
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-24.04
env:
BASE_URL: https://keila.io
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: "Build & Deploy"
run: |
# Install Node
sudo apt update && sudo apt install nodejs
# Install packages and build
npm ci
GITHUB_TOKEN=${{ secrets.GH_TOKEN }} GITHUB_PROJECT_TOKEN=${{ secrets.GH_PROJECT_TOKEN }} npm run build
# Add SSH key
mkdir ~/.ssh
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa
echo "${{ secrets.KNOWN_HOSTS }}" > ~/.ssh/known_hosts
chmod 600 ~/.ssh/*
# Deploy
DEPLOY_TARGET=${{ secrets.DEPLOY_TARGET }} npm run deploy