GregBrimble / tailwindui-crawler-action

Automate the crawling and cataloging of the Tailwind UI components
https://tailwindui.com
MIT License
26 stars 13 forks source link

Setting this up to work #5

Closed connecteev closed 4 years ago

connecteev commented 4 years ago

@GregBrimble this workflow looks amazing, but I'm having trouble setting this up and testing that it works.

name: Example/Test
on:
  push:
  schedule:
    - cron: "0 0 * * *" # Every day at midnight

jobs:
  test:
    name: Example/Test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Run crawler
        uses: gregbrimble/tailwindui-crawler-action@master
        with:
          email: ${{ secrets.TAILWINDUI_EMAIL}}
          password: ${{ secrets.TAILWINDUI_PASSWORD }}

At no time did I clone https://github.com/GregBrimble/tailwindui-crawler-action or https://github.com/kiliman/tailwindui-crawler/

Am I missing a step? Thank you!

GregBrimble commented 4 years ago

Hi @connecteev !

Thanks for trying this out :) Sorry it isn't working for you straightaway.

Have you first tried the example config in the README.md?

# .github/workflows/default.yml

name: Update
on:
  schedule:
    - cron: "0 0 * * *" # Every day at midnight

jobs:
  update:
    name: Update
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Run crawler
        uses: gregbrimble/tailwindui-crawler-action@v1.0.0
        with:
          email: ${{ secrets.TAILWINDUI_EMAIL }}
          password: ${{ secrets.TAILWINDUI_PASSWORD }}

This obviously schedules this to be run every day at midnight, so feel free to adjust the cron schedule so you can more test it more rapidly.

Setting up the secrets sounds good, and notifications sound fine. And you shouldn't need to clone either repo, since this happens in the Action.

Do you have any errors appearing in the Action logs?

If possible, please provide a screenshot/copy-paste of those logs, and of your yml file configuration, and I can dig into this for you :)

connecteev commented 4 years ago

Thanks @GregBrimble I got it to work....and it works like magic :) I had made a really dumb error where my default.yml was not placed within .github/workflows/default.yml (though I thought I had), moving it to the correct place fixed it.

connecteev commented 4 years ago

@GregBrimble Quick questions here

  1. Let's say the cron runs every minute of every hour, is that too much? What is the drawback of doing that?
  2. I assume this code will auto-update either when:
    • tailwindui source code changes
    • tailwindui-crawler code changes Is that correct?

Thanks for this repo, it's starting to make me think about what else github actions can be used for!

GregBrimble commented 4 years ago
  1. Every minute of every hour is definitely overkill. TailwindUI is updated relatively infrequently (less than once a week, typically), so there is no need to be checking that frequently, (since no changes would be made). In fact, since the action takes longer than a minute to complete, it may actually cause problems when committing the changes because of conflicts with concurrent committing actions.

    Besides, anything too regular is just putting unnecessary strain on both tailwindui.com (and they wouldn't be too happy) and on GitHub Actions itself (and you will quickly overrun your free quota!). I set once a day as a reasonable default example. But feel free to adjust to something like twice a day if you need.

  2. The action will always fetch the latest TailwindUI code. The version of the kilman's https://github.com/kiliman/tailwindui-crawler can be selected by specifying crawlerref (see the Advanced section of the README.md). By default, it uses the latest version, master.

    As for the version of this action, if in your config, you have uses: gregbrimble/tailwindui-crawler-action@v1.0.0, you will be pinned to version 1.0.0. I do suggest pinning your version, just in case I ever break master, but you can configure this however you wish.

    I recommend watching this repository (Releases only) to be notified when I release a new version.

I'm glad it has inspired you! Check out https://github.com/sdras/awesome-actions for some other excellent projects.

connecteev commented 4 years ago

@GregBrimble Very interesting!

  1. I didnt know that github actions had a quota...also great point as each job would take longer than 1 min to run anyway! I have reduced the frequency down to once every 6 or 12 hours...so I can get notified of the update sooner.
  2. Thanks for the tip on the advanced settings, I am going to stick with your defaults for now since they work well! And, I have pinned the tailwindui-crawler-action version to gregbrimble/tailwindui-crawler-action@v1.0.0, per your recommendation. I am watching this repo for changes as well :)

Both this project and the original one by kiliman are amazing..thanks for doing it.

ps. I have also starred https://github.com/sdras/awesome-actions -- I was wondering if there's an easy and free way to monitor my website's uptime with github actions, but I guess I could just use the free plan of https://uptimerobot.com/pricing !

GregBrimble commented 4 years ago
  1. Just for private repos, I think :) Sounds good 👍
  2. Awesome :)

Great idea! Should be pretty simple to implement. The hardest part would be finding somewhere to dump your data (although I suppose you could commit it to git?) I do have a simpler (unrelated) GitHub Action here, which you might be able to use as a starting point? Good luck!

connecteev commented 4 years ago

@GregBrimble thats awesome, thanks for the tip.

Unrelated, do you want to collaborate on any projects I'm working on? Some things I have in progress: Painless saas payments in Laravel (Plan upgrades and downgrades, Free trials both during registration / without payment, and after payment, Plan cancelations, Prorations, Grace periods, etc). The goal is to do this once, make it bullet proof and never have to worry about it again (other than minimal maintenance). Would be great to get the help of another smart person. Discord handle in bio if interested!

GregBrimble commented 4 years ago

@connecteev , added you!