34 lines
No EOL
1.2 KiB
YAML
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 script.js -o script.min.js && uglifyjs simplex.js -o simplex.min.js && uglifyjs style.css -o 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 }} |