feat: moved to gitea workflows for CI/CD
Some checks failed
Build and deploy blog / Build-and-deploy (push) Failing after 10s
Some checks failed
Build and deploy blog / Build-and-deploy (push) Failing after 10s
Signed-off-by: Louis Vallat <contact@louis-vallat.dev>
This commit is contained in:
parent
a231eab2f5
commit
02ae6a6a03
28
.gitea/workflows/build_and_deploy.yml
Normal file
28
.gitea/workflows/build_and_deploy.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
name: Build and deploy blog
|
||||||
|
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
|
@ -1,21 +0,0 @@
|
|||||||
image: alpine
|
|
||||||
|
|
||||||
variables:
|
|
||||||
GIT_SUBMODULE_STRATEGY: recursive
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- deploy
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
stage: deploy
|
|
||||||
before_script:
|
|
||||||
- apk add openssh zola rsync
|
|
||||||
- eval $(ssh-agent -s)
|
|
||||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
|
||||||
- mkdir -p ~/.ssh
|
|
||||||
- chmod 700 ~/.ssh
|
|
||||||
script:
|
|
||||||
- zola build
|
|
||||||
- rsync -e "ssh -o StrictHostKeyChecking=no -p $SSH_PORT" -rvz ./public/ $SSH_DESTINATION:/var/www/blog.louis-vallat.dev/ --delete
|
|
||||||
only:
|
|
||||||
- master
|
|
Loading…
Reference in New Issue
Block a user