kiliman / tailwindui-crawler

tailwindui-crawler downloads the component HTML files locally
MIT License
763 stars 95 forks source link

GitHub Action #23

Closed GregBrimble closed 4 years ago

GregBrimble commented 4 years ago

Hello! Thank you for creating this excellent tool. It has already saved me many hours!

I have created a GitHub Action to automatically run this project, and push the output to a GitHub repo. This allows users to maintain a git version controlled copy of all the components, and for it to keep itself up-to-date.

It also supports the .env file for this project, so you can run all your transformers, and login info is kept securely in secrets.

I'd appreciate any feedback/input/questions you might have, and would love to put this somewhere on your README.md, if you think it could help others.

kiliman commented 4 years ago

Awesome. I'm glad you are finding it useful. If you want to add it to the README, send me a PR and I'll merge it.

I'm lazy so I'm always looking for ways to automate repetitive tasks.

I've been working on a workflow for keeping track of my custom React components. Basically I add a comment to my component with the commit hash of the original file. Then when I get the latest updates, I have a script that will tell me which files were changed and what component I need to check. After I make any changes, I update the hash, ready for the next update.

Adam makes a bunch of CSS tweaks so I want to keep my components in sync as much as possible.

GregBrimble commented 4 years ago

I'll get that PR in shortly.

I'm in the same boat. But with this action automatically updating a repo for you, you can just setup GitHub Notifications to be emailed on every change 🎉

I also have planned a feature to create a PR, rather than just push changes straight to master. I'm envisioning using that as a sort of issue tracker, where users merge the PR once they have made the changes to their components in the various apps they're using TWUI.

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 , I've answered you over on the action repo: https://github.com/GregBrimble/tailwindui-crawler-action/issues/5.

connecteev commented 4 years ago

thanks @GregBrimble, I got it to work!

GregBrimble commented 4 years ago

~Amazing @connecteev ! What was the trick?~ Discussed on original issue: https://github.com/GregBrimble/tailwindui-crawler-action/issues/5.

connecteev commented 4 years ago

@GregBrimble no trick - your instructions in the readme were correct! It was a mistake on my part...thank you!

connecteev commented 4 years ago

@kiliman sorry to "bug" you with this, but I've been using @GregBrimble 's excellent github action which makes use of this repo to auto-build tailwindui. I am wondering if you have an idea why his action doesn't work when I add the prefixClasses transformer to the env...and it doesnt seem to build a local css file. It only works if you get tailwind.css from the CDN. Here's the issue I am seeing: https://github.com/GregBrimble/tailwindui-crawler-action/issues/7#issuecomment-629690361

As an aside, here's how his code is triggering your crawler build: https://github.com/GregBrimble/tailwindui-crawler-action/blob/f40d23da58140d1271bea395736fd3bf6b3338d3/entrypoint.sh#L54