2024-11-16 12:11:00 +00:00
|
|
|
name: Build & Deploy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-or-sth:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-11-16 12:19:27 +00:00
|
|
|
- name: Clone repo
|
2024-11-16 12:31:34 +00:00
|
|
|
run: git clone --recurse-submodules https://git.emin.software/haxala1r/blog.git --depth=1 .
|
2024-11-16 12:36:14 +00:00
|
|
|
- name: Get hugo
|
2024-11-16 13:00:18 +00:00
|
|
|
run: |
|
|
|
|
wget https://github.com/gohugoio/hugo/releases/download/v0.131.0/hugo_extended_0.131.0_linux-amd64.tar.gz -O hugo.tar.gz
|
|
|
|
tar xzvf hugo.tar.gz
|
|
|
|
- name: Build
|
2024-11-16 12:36:14 +00:00
|
|
|
run: ./hugo
|
2024-11-16 13:00:18 +00:00
|
|
|
- name: Deploy
|
2024-11-16 12:49:34 +00:00
|
|
|
run: |
|
2024-11-16 13:00:18 +00:00
|
|
|
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id
|
2024-11-16 13:01:32 +00:00
|
|
|
chmod 600 ~/.ssh/id
|
2024-11-16 13:00:18 +00:00
|
|
|
ssh-keyscan emin.software > ~/.ssh/known_hosts
|
|
|
|
scp -oUser=${{secrets.SSH_USER}} -i ~/.ssh/id -r public/* emin.software:${{secrets.WEB_PATH}}
|