website/.gitea/workflows/action.yml
fzorb 82526309ac
Some checks failed
pipeline / deploy-job (push) Failing after 34s
hopefully move to a new host 🙏
2024-11-30 22:49:11 +02:00

46 lines
1.1 KiB
YAML

name: pipeline
on:
push:
branches:
- main
jobs:
deploy-job:
runs-on: ubuntu-latest
steps:
- name: init env
run: |
sudo apt-get update
sudo apt-get install -y rsync openssh-client hugo git
- name: init git
run: |
git clone https://git.fzorb.xyz/fzorb/website
cd website
git submodule foreach --recursive git reset --hard
git submodule init
git submodule update --recursive
- name: generate site
run: |
ls -a
cd website
ls -a
hugo
- name: init ssh
run: |
mkdir -p ~/.ssh
echo "${{ secrets.PRIVKEY2 }}" | base64 -d > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -p 22 10.14.0.205 >> ~/.ssh/known_hosts
- name: upload new files
run: |
rsync -avzh website/public/ -e "ssh -i ~/.ssh/id_rsa -p 22" --omit-dir-times git@10.14.0.205:/var/www/fzorb.xyz
- name: fix perms
run: |
ssh -i ~/.ssh/id_rsa -p 22 git@10.14.0.205 "chmod 755 -R /var/www/fzorb.xyz"