diff --git a/.github/workflows/dispatch-deploy.yml b/.github/workflows/dispatch-deploy.yml new file mode 100644 index 000000000..66e2a588d --- /dev/null +++ b/.github/workflows/dispatch-deploy.yml @@ -0,0 +1,22 @@ +# This is a basic workflow that is manually triggered + +name: Deploy workflow + +on: + pull_request: + types: [closed] + branches: + - tw + +jobs: + dispatch_event: + if: github.event.pull_request.merged == true + 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.yml b/.github/workflows/sync.yml new file mode 100644 index 000000000..9c129bc77 --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,41 @@ +name: Sync Fork + +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