Bronze: Dentalteam #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on: https://swharden.com/blog/2022-03-20-github-actions-hugo/ | |
name: hugo-deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup Hugo | |
env: | |
HUGO_VERSION: 0.129.0 | |
run: | | |
mkdir ~/hugo | |
cd ~/hugo | |
curl -L "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz" --output hugo.tar.gz | |
tar -xvzf hugo.tar.gz | |
sudo mv hugo /usr/local/bin | |
- name: Build | |
run: hugo --minify | |
- name: Create empty key file | |
run: install -m 600 -D /dev/null ~/.ssh/id_rsa | |
- name: Populate key | |
run: echo "${{ secrets.PRIVATE_SSH_KEY }}" > ~/.ssh/id_rsa | |
- name: Upload | |
run: rsync --archive --stats -e 'ssh -o StrictHostKeyChecking=no' public/ [email protected]:/home/tsvmetta/www/jtf2025.ch/ |