myco.systems/.gitea/workflows/deploy.yaml
Brooke 0b39fb1264
Some checks failed
Hugo / build (push) Failing after 23s
fix about page and test deploy
2024-03-14 18:08:20 -04:00

34 lines
No EOL
1.2 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: cd public/ && html-minifier --input-dir . --output-dir . --file-ext html --collapse-whitespace --remove-comments --remove-optional-tags index.html && cd ..
- name: Minify CSS & JS
run: cd public/ && uglifyjs public/script.js -o public/script.min.js && uglifyjs public/simplex.js -o public/simplex.min.js && uglifyjs public/style.css -o public/style.min.css && cd ..
- 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 }}