Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
klercke committed Jun 1, 2024
1 parent c59032b commit 113ee43
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/blog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Based on https://swharden.com/blog/2022-03-20-github-actions-hugo/
name: Build & Push to Site

on:
workflow_dispatch:
push:
branches:
- main

jobs:
deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: πŸ›’ Checkout
uses: actions/checkout@v3
- name: ✨ Setup Hugo
env:
HUGO_VERSION: 0.126.2
run: |
mkdir ~/hugo
cd ~/hugo
curl -L "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${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
- name: πŸ” Create 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]:/srv/http/blog.z3r0d4y.dev/public

0 comments on commit 113ee43

Please sign in to comment.