myco.systems/.gitea/workflows/deploy.yaml
Brooke 92fb220b7f
Some checks failed
Hugo / build (push) Failing after 35s
correct file locations
2024-03-14 18:01:18 -04:00

34 lines
No EOL
1.1 KiB
YAML

name: Hugo
on: [push]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Grab packages
run: |
apt-get update && \
apt-get install --no-install-recommends --no-install-suggests -y jq rsync && \
npm install -g uglify-js && \
npm install -g html-minifier
- name: Minify HTML
run: html-minifier --input-dir public/ --output-dir public/ --file-ext html --collapse-whitespace --remove-comments --remove-optional-tags index.html
- name: Minify CSS & JS
run: uglifyjs public/script.js -o public/script.min.js && uglifyjs public/style.css -o public/style.min.css
- name: Test static page
run: bash ${{ gitea.workspace }}/bin/test_static_page.sh
- name: Deploy to Server
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-rlgoDzvc -i --delete"
SOURCE: "public/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}