34 lines
762 B
YAML
34 lines
762 B
YAML
name: build-and-deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: 'lightsail-runner'
|
|
container:
|
|
image: klakegg/hugo:0.121.1-ext-ubuntu
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Build site
|
|
run: hugo --minify
|
|
env:
|
|
HUGO_ENV: production
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18'
|
|
|
|
- name: Install and Deploy with Surfer
|
|
run: |
|
|
npm install -g cloudron-surfer
|
|
if ! surfer put --token ${{ secrets.SURFER_TOKEN }} --server ${{ secrets.SURFER_SERVER }} public/* /; then
|
|
echo "Deployment failed"
|
|
exit 1 |