Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Stvad opened this issue Apr 17, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@Stvad
Copy link

Stvad commented Apr 17, 2020

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
Copy link
Author

Stvad commented Apr 17, 2020

@Stvad
Copy link
Author

Stvad commented Apr 17, 2020

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
Copy link
Author

Stvad commented Apr 17, 2020

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

@MatthieuBizien
Copy link
Owner

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

@Stvad
Copy link
Author

Stvad commented Apr 18, 2020

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

@Stvad
Copy link
Author

Stvad commented Apr 18, 2020

Ah missed the commit - added some comments to it

@Stvad
Copy link
Author

Stvad commented Apr 19, 2020

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

@MatthieuBizien
Copy link
Owner

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 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants