Folder Changes #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Documentation Sync | |
on: | |
push: | |
branches: | |
- main | |
env: | |
GIT_AUTHOR_NAME: Actionbot | |
GIT_AUTHOR_EMAIL: actions@github.com | |
jobs: | |
job-create-documentation-directory: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if Docs Directory Exists | |
run: | | |
if [ ! -d "documentation" ]; then | |
echo "Creating documentation directory..." | |
mkdir documentation | |
else | |
echo "Docs directory already exists." | |
fi | |
job-sync-documentation-to-wiki: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'gollum' | |
needs: job-create-documentation-directory | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Sync documentation to wiki | |
uses: newrelic/wiki-sync-action@main | |
with: | |
source: documentation | |
destination: wiki | |
token: ${{ secrets.GITHUB_TOKEN }} | |
gitAuthorName: ${{ env.GIT_AUTHOR_NAME }} | |
gitAuthorEmail: ${{ env.GIT_AUTHOR_EMAIL }} | |
branch: main | |
job-sync-wiki-to-documentation: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'gollum' | |
needs: job-create-documentation-directory | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Publish Wiki | |
uses: spenserblack/actions-wiki@v0.3.0 | |
with: | |
path: documentation | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |