Skip to content

Instantly share code, notes, and snippets.

@jonathanvoelkle
Last active February 3, 2021 14:50
Show Gist options
  • Save jonathanvoelkle/65295fd1f57029fdfc7e2ae781e7826f to your computer and use it in GitHub Desktop.
Save jonathanvoelkle/65295fd1f57029fdfc7e2ae781e7826f to your computer and use it in GitHub Desktop.
roam-backup
name: "Roam Research EDN backup"
on:
schedule:
- cron: "0 4 * * *"
jobs:
backup:
runs-on: macos-latest
name: Backup
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Setup Dependencies
run: |
brew install borkdude/brew/jet
pip install git+https://github.com/adithyabsk/roam-to-git.git@master
- name: Run backup
run: |
roam-to-git --skip-git -f edn -- .
env:
ROAMRESEARCH_USER: ${{ secrets.ROAMRESEARCH_USER }}
ROAMRESEARCH_PASSWORD: ${{ secrets.ROAMRESEARCH_PASSWORD }}
ROAMRESEARCH_DATABASE: ${{ secrets.ROAMRESEARCH_DATABASE }}
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automated snapshot ${{ github.run_number }}
name: "Roam Research backup"
on:
push:
branches:
- main
schedule:
- cron: "20 * * * *"
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.ROAMRESEARCH_USER }}
ROAMRESEARCH_PASSWORD: ${{ secrets.ROAMRESEARCH_PASSWORD }}
ROAMRESEARCH_DATABASE: ${{ secrets.ROAMRESEARCH_DATABASE }}
- name: Commit changes
uses: elstudio/actions-js-build/commit@v3
with:
commitMessage: Automated snapshot ${{ github.run_number }}
@tombarys
Copy link

Hi, Jonathan, could you give me some simple instructions on how to use this script on my MacOS? I am lost. Thank you! Tomáš

@jonathanvoelkle
Copy link
Author

Hi @tombarys, here are some instructions on how to set it up generally https://github.com/MatthieuBizien/roam-to-git
and here are the instructions on how to use it with GitHub actions https://eriknewhard.com/blog/backup-roam-in-github (what I would recommend)
Hope this helps; I don't know how to set it up specifically on MacOS, sorry. You might want to ask on the roam-slack.

@tombarys
Copy link

tombarys commented Feb 3, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment