diff --git a/.github/workflows/dispatch-sync.yml b/.github/workflows/dispatch-sync.yml new file mode 100644 index 000000000..0ed188e5a --- /dev/null +++ b/.github/workflows/dispatch-sync.yml @@ -0,0 +1,21 @@ +# This is a basic workflow that is manually triggered + +name: Dispatch sync-event + +on: + push: + branches: + - tw + - v2 + +jobs: + dispatch_event: + runs-on: ubuntu-latest + steps: + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v1.1.3 + with: + token: ${{ secrets.REPO_ACCESS_TOKEN }} + repository: ashramwen/tailwindcss.com + event-type: sync-event + client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' diff --git a/.github/workflows/sync-tw.yml b/.github/workflows/sync-tw.yml new file mode 100644 index 000000000..086451f8a --- /dev/null +++ b/.github/workflows/sync-tw.yml @@ -0,0 +1,41 @@ +name: Sync tw + +on: + schedule: + - cron: '*/30 * * * *' # every 30 minutes + workflow_dispatch: # on button click + repository_dispatch: + types: [sync-event] + +jobs: + sync_with_upstream: + runs-on: ubuntu-latest + name: Sync main with upstream latest + + steps: + # Step 1: run a standard checkout action, provided by github + - name: Checkout main + uses: actions/checkout@v2 + with: + ref: tw + # submodules: 'recursive' ### may be needed in your situation + + # Step 2: run this sync action - specify the upstream repo, upstream branch to sync with, and target sync branch + - name: Pull (Fast-Forward) upstream changes + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v2.3 + with: + upstream_repository: tailwindcss-tw/tailwindcss.com + upstream_branch: tw + target_branch: tw + git_pull_args: --ff-only # optional arg use, defaults to simple 'pull' + github_token: ${{ secrets.GITHUB_TOKEN }} # optional, for accessing repos that require authentication + + # Step 3: Display a message if 'sync' step had new commits (simple test) + - name: Check for new commits + if: steps.sync.outputs.has_new_commits + run: echo "There were new commits." + + # Step 4: Print a helpful timestamp for your records (not required, just nice) + - name: Timestamp + run: date diff --git a/.github/workflows/sync-v2.yml b/.github/workflows/sync-v2.yml new file mode 100644 index 000000000..9f320a782 --- /dev/null +++ b/.github/workflows/sync-v2.yml @@ -0,0 +1,41 @@ +name: Sync v2 + +on: + schedule: + - cron: '*/30 * * * *' # every 30 minutes + workflow_dispatch: # on button click + repository_dispatch: + types: [sync-event] + +jobs: + sync_with_upstream: + runs-on: ubuntu-latest + name: Sync main with upstream latest + + steps: + # Step 1: run a standard checkout action, provided by github + - name: Checkout main + uses: actions/checkout@v2 + with: + ref: v2 + # submodules: 'recursive' ### may be needed in your situation + + # Step 2: run this sync action - specify the upstream repo, upstream branch to sync with, and target sync branch + - name: Pull (Fast-Forward) upstream changes + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v2.3 + with: + upstream_repository: tailwindcss-tw/tailwindcss.com + upstream_branch: v2 + target_branch: v2 + git_pull_args: --ff-only # optional arg use, defaults to simple 'pull' + github_token: ${{ secrets.GITHUB_TOKEN }} # optional, for accessing repos that require authentication + + # Step 3: Display a message if 'sync' step had new commits (simple test) + - name: Check for new commits + if: steps.sync.outputs.has_new_commits + run: echo "There were new commits." + + # Step 4: Print a helpful timestamp for your records (not required, just nice) + - name: Timestamp + run: date