Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add Example & README.md
  • Loading branch information
Greg Brimble committed Apr 25, 2020
1 parent 4530ef7 commit 8beae80
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/default.yml
@@ -0,0 +1,23 @@
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 }}

# The following are optional (see the README.md for more info)
token: ${{ secrets.TOKEN }}
output: gregbrimble/tailwindui
repository: gregbrimble/tailwindui
46 changes: 45 additions & 1 deletion README.md
Expand Up @@ -2,6 +2,50 @@

> Automate the crawling and cataloging of the Tailwind UI components

[![GitHub Actions Example/Test](https://github.com/GregBrimble/tailwindui-crawler-action/workflows/Example/Test/badge.svg)](https://github.com/GregBrimble/tailwindui-crawler-action/actions?query=workflow%3AExample%2FTest)

## Usage

Create a **PRIVATE** repository on GitHub, and add this action to run on a schedule.
As a part of your [GitHub Actions](https://github.com/features/actions) workflow, add a new step as follows:

```yml
name: Deploy
on:
push:
schedule:
- cron: "0 0 * * *" # Every day at midnight
jobs:
deploy:
name: Deploy
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 }}
```

Read more about the schedule cron syntax in [the official GitHub Actions documentation](https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule).

We strongly advise utilizing [GitHub Actions secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) to securely store your TailwindUI email and password.

A full example can be found in [`.github/workflows/default.yml`](https://github.com/GregBrimble/tailwindui-crawler-action/blob/master/.github/workflows/default.yml).

## Advanced

The following input options are available:

| Name | Value |
| ---------- | ----------------------------------------- |
| `email` | Your tailwindui.com account email address |
| `password` | Your tailwindui.com account password |

Note: If using a separate private repository for the output, you must include a Personal Access Token in the `token` input, as the `{{ github.token }}` tokens are scoped to only the current repository.

## Roadmap

[] Specify crawler version
[] Create a PR against the output repository
2 changes: 1 addition & 1 deletion entrypoint.sh
Expand Up @@ -3,6 +3,7 @@
export WORKSPACE_REPOSITORY="$INPUT_REPOSITORY"
export CRAWLER_REPOSITORY="$INPUT_CRAWLER"
export OUTPUT_REPOSITORY="$INPUT_OUTPUT"
export INPUT_REF="master"
unset INPUT_REPOSITORY

# Clone crawler
Expand Down Expand Up @@ -49,7 +50,6 @@ export OUTPUT="/output"
export EMAIL="$INPUT_EMAIL"
export PASSWORD="$INPUT_PASSWORD"

ls /crawler
node /crawler/index.js

# Commit changes
Expand Down

0 comments on commit 8beae80

Please sign in to comment.