Skip to content

20240507

20240507 #80

Workflow file for this run

name: Deploy
on:
push:
branches: [ main ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout Files
uses: actions/checkout@main
- name: Validate Caddyfile
run: |
docker run -v ./caddy:/data ghcr.io/jonaharagon/caddy-build:latest caddy validate --config /data/Caddyfile
deploy:
needs: [validate]
runs-on: ubuntu-latest
if: github.event.repository.fork == false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Sync node version and setup cache
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Rsync
uses: up9cloud/action-rsync@v1.4
env:
USER: website
HOST: ${{ secrets.VPS_HOST }}
KEY: ${{ secrets.VPS_SSH_PRIVATE_KEY }}
TARGET: "/home/website/thenewoil/"
ARGS: '-z -r -v -l -t --delete-after --exclude node_modules/ .git/'