MatthieuBizien/roam-to-git

Suggestion: use Github actions to execute backup & commit changes to the repository

Stvad opened this issue · 8 comments

Stvad commented

The alternative backup implementation: https://github.com/signalnerve/roam-backup does that, and it seems like a pretty great way to go about - it's free & there are already workflow templates to checkout/update repository.

Stvad commented

this is close to working

name: "Roam Research backup"

on:
  push:
    branches:
      - master
  schedule:
    - cron: "*/10 * * * *"

jobs:
  backup:
    runs-on: ubuntu-latest
    name: Backup
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python 3.8
        uses: actions/setup-python@v1
        with:
          python-version: 3.8
      
      - name: Setup dependencies
        run: |
          pip install git+https://github.com/MatthieuBizien/roam-to-git.git
      - name: Run backup
        run: roam-to-git --skip-git .
        env:
          ROAMRESEARCH_USER: ${{ secrets.roamEmail }}
          ROAMRESEARCH_PASSWORD: ${{ secrets.roamPassword }}
          ROAMRESEARCH_DATABASE: ${{ secrets.roamDatabase }}
          
      - name: Commit changes
        uses: elstudio/actions-js-build/commit@v3
        with:
          commitMessage: Automated snapshot
Stvad commented

it actually does work it seems. An interesting story - got a bunch more things on markdown export when running from Github actions vs running locally on mac. suspect it's related to case-insensitivity of mac FS. Something to consider

That was something I wanted to do, thanks for the help! Very good point about case sensitivity.

Stvad commented

I think this needs an example repo & readme before being properly "completed" :)

Stvad commented

Ah missed the commit - added some comments to it

Stvad commented

Also I think it should be possible to have this based off public repo, (but pushing things to the private one). To allow easier setup and stay within limits of actions usage

Fixed in 6a8794b. Your last point is interesting, but I'm not sure how to do it. I think it's worth a new issue 😃