feat: add CI/CD to automatically deploy
Some checks failed
Deploy Website / build-and-deploy (push) Failing after 12s
Some checks failed
Deploy Website / build-and-deploy (push) Failing after 12s
This commit is contained in:
parent
4430469cdc
commit
0e526907e9
27
.gitea/workflows/deploy.yaml
Normal file
27
.gitea/workflows/deploy.yaml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
name: Deploy Website
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: native
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build article code
|
||||||
|
run: |
|
||||||
|
nix-build -A articles
|
||||||
|
|
||||||
|
- name: Deploy article HTML
|
||||||
|
run: |
|
||||||
|
cat - <<EOD > ssh-key
|
||||||
|
${{ secrets.DEPLOY_SSH_KEY }}
|
||||||
|
EOD
|
||||||
|
|
||||||
|
nix-shell -p rsync openssh --run \
|
||||||
|
'rsync -avz -e "ssh -oStrictHostKeyChecking=accept-new -i ssh-key" result/* deploy@andrew.riouxs.co:/srv/site'
|
||||||
|
|
||||||
|
- name: Remove SSH key
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
shred ssh-key
|
||||||
@ -19,7 +19,4 @@ let
|
|||||||
find . -name '*.org' -exec build-article {} \;
|
find . -name '*.org' -exec build-article {} \;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in {
|
in { inherit build-article articles; }
|
||||||
inherit build-article articles;
|
|
||||||
default = articles;
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user