try to upload using private key

This commit is contained in:
Cyryl Płotnicki 2023-08-12 18:56:26 +01:00
parent fc6b13ff15
commit 09f2c13630

View file

@ -4,7 +4,7 @@ on: push
env:
DEV_SHELL_NAME: CI
jobs:
check_config:
Check config:
runs-on: flakes-action
steps:
- uses: actions/checkout@v3
@ -18,15 +18,20 @@ jobs:
- name: Flake check
run: |
nix flake check
build:
Publish:
runs-on: flakes-action
steps:
- uses: actions/checkout@v3
name: Checkout
- name: build
- name: Build
run: |
nix develop -c hugo --gc --minify
- name: publish
- name: Publish
run: |
echo "TODO: copy private key"
nix develop -c rsync -avz public/ root@mb1:/var/www/blog/
mkdir -p ~/.ssh/
cat >> ~/.ssh/id_ed25519 << EOF
${{ secrets.MB1_SSH_UPLOAD_KEY }}
EOF
chmod 400 ~/.ssh/id_ed25519
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILqDeXcIQwLXxuueu9KTC6y6NPUUzDRdF4Q5NUk+nFwt upload@blog" > ~/.ssh/id_ed25519.pub
nix develop -c rsync -avz -e 'ssh -o StrictHostKeyChecking=accept-new' public/ blog@blog.cyplo.net:/var/www/blog/