Publish Wiki #552
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Publish Wiki" | |
on: | |
schedule: | |
# Run every day at 01:30 UTC | |
- cron: '30 1 * * *' | |
workflow_dispatch: | |
jobs: | |
deploy-to-server: | |
runs-on: ubuntu-latest | |
steps: | |
# See documentation for the action | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.GIT_SSH_KEY }} | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
if_key_exists: fail | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
repository: ictunion/wiki | |
ref: main | |
ssh-key: ${{ secrets.GIT_SSH_KEY }} | |
ssh-known-hosts: ${{ secrets.KNOWN_HOSTS }} | |
- name: Install nix | |
uses: cachix/install-nix-action@v18 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Build wiki | |
run: nix build | |
- name: Deploy wiki | |
run: | | |
nix-shell -p rsync --run 'rsync -rt result/var wiki@ictunion.cz:/home/wiki' |