diff --git a/.github/workflows/publish-organizers-wiki.yaml b/.github/workflows/publish-organizers-wiki.yaml new file mode 100644 index 0000000..dc43012 --- /dev/null +++ b/.github/workflows/publish-organizers-wiki.yaml @@ -0,0 +1,39 @@ +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/organizers-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/organizers-wiki'