name: publish on: push: branches: - main jobs: publish: runs-on: ubuntu-latest env: SSH_PRIVATE_KEY: ${{ secrets.PUBLISHER_PRIVATE_KEY }} steps: - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 # all history for all branches and tags\ - name: Install Hugo run: | apt update && apt install -y hugo - name: Build run: | hugo --minify - name: Deploy run: | eval $(ssh-agent -s) echo "$SSH_PRIVATE_KEY" | ssh-add - apt update && apt install -y rsync mkdir ~/.ssh ssh-keyscan -p 3001 sakura.local > ~/.ssh/known_hosts rsync -atv --progress --delete -e 'ssh -p 3001' ./public/ publisher@sakura.local:/usr/share/nginx/html/