Skip to content

Updated workflow for bidirectional wiki-docs syncing (#646) #2

Updated workflow for bidirectional wiki-docs syncing (#646)

Updated workflow for bidirectional wiki-docs syncing (#646) #2

Workflow file for this run

name: Documentation
on:
push:
branches:
- main
paths:
- "docs/**"
repository_dispatch:
types: [docs]
gollum:
env:
GIT_AUTHOR_NAME: Actionbot
GIT_AUTHOR_EMAIL: [email protected]
SYNC_CHANGES_REPO_NAME: docs-sync
jobs:
job-sync-docs-to-wiki:
runs-on: ubuntu-latest
if: github.event_name != 'gollum'
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Sync docs to wiki
uses: UnitTestBot/wiki-sync-action@main
with:
source: docs
destination: wiki
token: ${{ secrets.ACCESS_TOKEN }}
gitAuthorName: ${{ env.GIT_AUTHOR_NAME }}
gitAuthorEmail: ${{ env.GIT_AUTHOR_EMAIL }}
job-sync-wiki-to-docs:
runs-on: ubuntu-latest
if: github.event_name == 'gollum'
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
token: ${{ secrets.ACCESS_TOKEN }} # allows us to push back to repo
- name: Sync Wiki to Docs
uses: UnitTestBot/wiki-sync-action@main
with:
source: wiki
destination: docs
token: ${{ secrets.ACCESS_TOKEN }}
gitAuthorName: ${{ env.GIT_AUTHOR_NAME }}
gitAuthorEmail: ${{ env.GIT_AUTHOR_EMAIL }}
branch: wiki_branch
- name: Create PR for success
run: |
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [[ "$BRANCH" != "main" ]]; then
gh pr create --fill
fi
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}