saitti/.forgejo/workflows/duuni.yaml
Jarkko Toivanen feee674e4f
Some checks failed
build / build (push) Successful in 36s
build / deploy (push) Failing after 24s
Fixing host verification stuff and things (skipping it)
2025-01-25 02:48:46 +02:00

37 lines
1.3 KiB
YAML

name: build
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "install dependencies"
run: apt update && apt install --no-install-recommends -y mkdocs mkdocs-material mkdocs-material-extensions
- name: "build & push"
run: mkdocs build
- uses: actions/upload-artifact@v3
with:
name: site
path: site/
deploy:
runs-on: ubuntu-latest
if: ${{ startsWith(secrets.SSH_PRIVATE_KEY, '-----BEGIN OPENSSH PRIVATE KEY-----') }}
needs: [build]
steps:
- name: Install dependencies
run: apt-get update && apt-get install --no-install-recommends -y rsync openssh-client
- name: Install SSH key
run: |
set -e
echo -e 'Installing ssh keys...'
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo -e "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_foobar
echo -e "${{ vars.SSH_PUBLIC_KEY }}" > ~/.ssh/id_foobar.pub
chmod 600 ~/.ssh/*
- uses: actions/download-artifact@v3
- name: Send built pages to server
run: rsync -e "ssh -o StrictHostKeyChecking=no" -rclthv --exclude .git --delete-after site/ ${{ vars.SSH_USER }}@${{ vars.SSH_HOST }}:${{ vars.SSH_PATH }}