-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (36 loc) · 1.17 KB
/
deploy.yml
File metadata and controls
47 lines (36 loc) · 1.17 KB
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
38
39
40
41
42
43
44
45
46
47
name: Deploy Website
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: 24
- name: Install esbuild
run: npm install esbuild
- name: Build site
run: |
mkdir -p dist
# Copy static assets
rsync -av --exclude='*.js' --exclude='*.css' site/ dist/
# Bundle + minify JS
npx esbuild site/js/*.js --bundle --minify --outdir=dist/js
# Minify CSS (esbuild can do this too)
npx esbuild site/css/*.css --minify --outdir=dist/css
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan ${{ secrets.DREAMHOST_HOST }} >> ~/.ssh/known_hosts
- name: Deploy via rsync
run: |
rsync -avz --delete \
dist/ \
${{ secrets.DREAMHOST_USERNAME }}@${{ secrets.DREAMHOST_HOST }}:/home/${{ secrets.DREAMHOST_USERNAME }}/codon64.com/