Skip to content

Commit

Permalink
feat(ci): setup autodeploy from main
Browse files Browse the repository at this point in the history
  • Loading branch information
rektdeckard committed Dec 28, 2024
1 parent 7d80171 commit a77e452
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/dreamhost-static.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and deploy to DreamHost via sshpass

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Install sshpass
run: sudo apt-get install -y sshpass

- name: Add SSH Key to known_hosts
env:
KNOWN_HOSTS_ENTRY: ${{ secrets.KNOWN_HOSTS_ENTRY }}
HOST: ${{ secrets.HOST }}
run: |
mkdir -p ~/.ssh
echo "$KNOWN_HOSTS_ENTRY" >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
- name: Build static site
run: pnpm build

- name: Deploy via rsync and sshpass
env:
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
HOST: ${{ secrets.HOST }}
DEPLOY_PATH: departuremono.com
run: |
sshpass -p "$PASSWORD" rsync -avz --delete ./dist/* $USERNAME@$HOST:$DEPLOY_PATH
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Departure Mono</title>
<meta name="title" content="Departure Mono">
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": true,
"version": "1.422.0",
"type": "module",
"packageManager": "pnpm@9",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
Expand Down
Binary file added public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon.ico
Binary file not shown.

0 comments on commit a77e452

Please sign in to comment.