Louis Vallat
626bdd7dee
All checks were successful
Build and deploy blog / Build-and-deploy (push) Successful in 6s
Signed-off-by: Louis Vallat <contact@louis-vallat.dev>
31 lines
809 B
YAML
31 lines
809 B
YAML
name: Build and deploy blog
|
|
defaults:
|
|
run:
|
|
shell: sh
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
|
|
jobs:
|
|
Build-and-deploy:
|
|
runs-on: alpine
|
|
steps:
|
|
- name: Install dependencies
|
|
run: |
|
|
apk add git openssh zola rsync
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'recursive'
|
|
- name: Build blog
|
|
run: |
|
|
zola build
|
|
- name: Deploy blog using rsync
|
|
run: |
|
|
eval $(ssh-agent -s)
|
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" | tr -d '\r' | ssh-add -
|
|
mkdir -p ~/.ssh
|
|
chmod 700 ~/.ssh
|
|
rsync -e "ssh -o StrictHostKeyChecking=no -p ${{ secrets.SSH_PORT }}" -rvz ./public/ ${{ secrets.SSH_DESTINATION }}:/var/www/blog.louis-vallat.dev/ --delete |