Add .gitea workflow

This commit is contained in:
Ariejan de Vroom 2024-03-25 14:17:10 +01:00
parent 8c986c26b3
commit 8ae6492029
Signed by: ariejan
GPG Key ID: AD739154F713697B
1 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,67 @@
name: Deploy
on:
push:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
deploy:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.124.1
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Sass
run: npm install -g sass
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify
- name: Mogrify / optimize images for the web
run: |
find ./public -name '*.jpg' -exec mogrify -auto-orient -monitor -sampling-factor 4:2:0 -strip -interlace JPEG -colorspace sRGB -resize 2048 -compress JPEG -quality 80 {} \;
- name: Rsync to remote
uses: burnett01/rsync-deployments@7.0.0
with:
switches: -avzr --delete
path: public/
remote_path: ${{ secrets.DEPLOY_PATH }}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_port: ${{ secrets.DEPLOY_PORT }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}