Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 🤖 Add workflows #144

Merged
merged 1 commit into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/dispatch-deploy.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: ashramwen/tailwindcss.com
event-type: sync-event
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
41 changes: 41 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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