Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
Add workflow to run the Mintlify migration
Browse files Browse the repository at this point in the history
The workflow runs the migration script and pushes to the `mintlify`
branch. It assumes that there is a GitHub app with its ID stored in
`vars` and private key in a secret, and that only this GitHub app has
permissions to push to the `mintlify` branch.
  • Loading branch information
ptgott committed Mar 8, 2024
1 parent d8cea86 commit 6d21705
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/mintlify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Migrate to Mintlify

on:
workflow_call:

push:
branches:
- main
paths:
- migration/**.mjs
- server/**.ts

jobs:
run-migration:
runs-on: ubuntu-latest
steps:
- name: Generate GitHub token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.MINTLIFY_MIGRATION_APP_ID }}
private-key: ${{ secrets.MINTLIFY_MIGRATION_PRIVATE_KEY }}

- name: Check out mintlify branch
uses: actions/checkout@v4
with:
ref: mintlify

- name: Run the migration script
run: |
yarn
yarn git-update
yarn build-node
yarn mintlify
- name: Push to the remote
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub"
git add migration-result
git commit -m "[auto] Sync Mintlify source"
git push --set-upstream origin mintlify
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}

0 comments on commit 6d21705

Please sign in to comment.