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 }}