oleeskild / obsidian-digital-garden

MIT License
1.41k stars 127 forks source link

Overcoming Vercel daily 100 deployment limit #320

Open ransurf opened 1 year ago

ransurf commented 1 year ago

I moved it to the other repository oops

kmdavis commented 1 year ago

the solution I'm using is to have 2 branches:

when you're ready to deploy, you run git push origin main:deployed to push changes from the main branch to the deployed branch

zanodor commented 1 year ago

I moved it to the other repository oops

Here it is now, for all to see.

I am curious how you've been doing with it a few months into it now?
I am deliberating between using your or @kmdavis's solution, but afraid to mess up an otherwise working Vercel setup.

ransurf commented 1 year ago

mine has been working consistently, the only errors i get are due to the plugin not being able to parse the content of my files, not related to deployment. i personally prefer mine since i don't have to worry about running a command, and i just have a button at the bottom of my daily note to remind me to push the changes every day :) if it doesn't work it should be reversible anyways

zanodor commented 1 year ago

push the changes

I would've thought you've had GitHub Actions automatize that?

ransurf commented 1 year ago

i mean that's what im doing with my script

On Tue, Oct 10, 2023 at 10:58 AM zanodor @.***> wrote:

push the changes

I would've thought you've had GitHub Actions automatize that?

— Reply to this email directly, view it on GitHub https://github.com/oleeskild/obsidian-digital-garden/issues/320#issuecomment-1755955477, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATIO6ZKV4U7F2SL7O45JSR3X6WEEPAVCNFSM6AAAAAAYQ6TXXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJVHE2TKNBXG4 . You are receiving this because you authored the thread.Message ID: @.***>

zanodor commented 1 year ago

Now, if I leave Build production automatic or change it as per how the other method goes, I have some interference with another production (which is supposed to be below-production level) with a strange id ("mfhqlufhq") that Vercel made up by default, no doubt, which overrides my new automation settings.
Screenshot from 2023-10-10 23-34-35 Leaving it at automatic, I have the issue in General: Screenshot from 2023-10-10 23-04-22

This is the production with the strange ID that comes up as the default in my Deployment tab as well.
Screenshot from 2023-10-10 23-42-07

I feel like I cannot go on unless I delete that. How can one proceed here? Is it something new at Vercel to have that as main deployment?

EDIT. This has nothing to do with anything. If one sets Only Build Production in Ignored Build Step, these messages come, but no need to worry.

zanodor commented 1 year ago

Another question: how can the GH Action script see the Vercel-saved personal token? I checked, it is correct (I mean I thought it was my PAT, then I deleted the content) and still cannot run the script for failed token: Input required and not supplied: token

ransurf commented 1 year ago

i honestly am not sure on how to help, and i'm not sure what token you need. I think I just set up env variables in GH actions

On Tue, Oct 10, 2023 at 3:02 PM zanodor @.***> wrote:

Another question: how can the GH Action script see the Vercel-saved personal token? I checked, it is correct and still cannot run the script for failed token: Input required and not supplied: token

— Reply to this email directly, view it on GitHub https://github.com/oleeskild/obsidian-digital-garden/issues/320#issuecomment-1756330765, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATIO6ZJPWAOVUOYB7GISZRDX6XAXNAVCNFSM6AAAAAAYQ6TXXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJWGMZTANZWGU . You are receiving this because you authored the thread.Message ID: @.***>

zanodor commented 1 year ago

I managed to make it wotk with PAT, which I had to register at GH Actions and in Vercel as well.
I followed advice and instructions from here.

My Actions script:

name: 'Daily auto-merge wth PAT'

on:
  schedule:
    # * is a special character in YAML so you have to quote this string
    # daily
    # - cron:  '0 0 * * *'
    # hourly at xx:50 time intervals, replace 50 with your desired minute
    - cron:  '50 * * * *'

jobs:
  merge:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          repository: <username>/<reponame>
          token: ${{ secrets.PAT_TOKEN }}
          fetch-depth: 0

      - name: Setup Git
        run: |
          git config --global user.name '<username>'
          git config --global user.email '<your-email-here>'

      - name: Merge and push
        run: |
          git fetch origin master:master
          git checkout master
          git merge main --no-ff -m "Merge main to master"
          git push https://${{ secrets.PAT_TOKEN }}@github.com/<username>/<reponame>.git master

Anybody seeing this, you only need to change <username> and <reponame> with your own credentials.

Thanks for your idea and help!

chrishutchison9 commented 1 year ago

The best way I've found to solve this for my use case with Cloudflare pages is to use Using concurrency - GitHub Docs. This way, you can use the multiple note publish feature without a run for every file.

For example, building in Github and pushing to Pages with workflows/publish.yml setting

concurrency:
  group: ${{ github.workflow }}
  cancel-in-progress: true
oleeskild commented 6 months ago

I've finally gotten around to implement this. I've released it as a Beta version for now, that can be installed via BRAT. Any feedback, either here or in the Discord is much appreciated 🙏

Release