blog/.gitea/workflows/build.yaml

37 lines
No EOL
1 KiB
YAML

name: build and publish
on: push
env:
DEV_SHELL_NAME: CI
jobs:
Check config:
runs-on: flakes-action
steps:
- uses: actions/checkout@v3
name: Checkout
- name: Metadata
run: |
nix flake metadata
- name: Statix
run: |
nix develop -c statix check
- name: Flake check
run: |
nix flake check
Publish:
runs-on: flakes-action
steps:
- uses: actions/checkout@v3
name: Checkout
- name: Build
run: |
nix develop -c hugo --gc --minify
- name: Publish
run: |
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/