2024-09-05 17:22:10 +03:00
|
|
|
name: pipeline
|
2024-09-05 17:10:41 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy-job:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: init env
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2024-11-30 23:00:44 +02:00
|
|
|
sudo apt-get install -y rsync openssh-client hugo git sshpass
|
2024-09-05 17:10:41 +03:00
|
|
|
|
|
|
|
- name: init git
|
|
|
|
run: |
|
|
|
|
git clone https://git.fzorb.xyz/fzorb/website
|
|
|
|
cd website
|
2024-09-09 21:33:55 +03:00
|
|
|
git submodule foreach --recursive git reset --hard
|
2024-09-05 17:10:41 +03:00
|
|
|
git submodule init
|
|
|
|
git submodule update --recursive
|
|
|
|
|
|
|
|
- name: generate site
|
|
|
|
run: |
|
2024-09-05 17:34:42 +03:00
|
|
|
ls -a
|
|
|
|
cd website
|
2024-09-05 17:33:51 +03:00
|
|
|
ls -a
|
2024-09-05 17:37:25 +03:00
|
|
|
hugo
|
2024-09-05 17:10:41 +03:00
|
|
|
|
|
|
|
- name: init ssh
|
|
|
|
run: |
|
2024-12-24 18:50:35 +02:00
|
|
|
ssh-keyscan -p 22 fzorb.xyz >> ~/.ssh/known_hosts
|
2024-09-05 17:10:41 +03:00
|
|
|
|
|
|
|
- name: upload new files
|
|
|
|
run: |
|
2024-12-24 18:50:35 +02:00
|
|
|
sshpass -p '${{secrets.PASSWD}}' rsync -avzh website/public/ -e ssh git@fzorb.xyz:/var/www/fzorb.xyz
|
2024-09-05 17:10:41 +03:00
|
|
|
|
|
|
|
- name: fix perms
|
|
|
|
run: |
|
2024-12-24 18:50:35 +02:00
|
|
|
sshpass -p '${{secrets.PASSWD}}' git@fzorb.xyz "chmod 777 -R /var/www/fzorb.xyz"
|