Skip to content

Merge pull request #109 from yunkon-kim/publish-articles-of-mc-net #121

Merge pull request #109 from yunkon-kim/publish-articles-of-mc-net

Merge pull request #109 from yunkon-kim/publish-articles-of-mc-net #121

name: Documentation
on:
push:
branches:
- main
paths:
- "docs/**"
repository_dispatch:
types: [docs]
gollum:
env:
# The default GIT_AUTHOR_NAME is github.actor
GIT_AUTHOR_NAME: ${{ github.actor }}
# The default GIT_AUTHOR_NAME is github.actor@users.noreply.github.com
GIT_AUTHOR_EMAIL: ${{ github.actor }}@users.noreply.github.com
WIKI: wiki
DOCS: docs
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: newrelic/wiki-sync-action@master
with:
source: ${{ env.DOCS }}
destination: ${{ env.WIKI }}
token: ${{ secrets.CR_PAT }}
# gitAuthorName: ${{ env.GIT_AUTHOR_NAME }}
# gitAuthorEmail: ${{ env.GIT_AUTHOR_EMAIL }}
commitMessage: Auto sync ${{ env.DOCS }} to ${{ env.WIKI }} [skip actions]
job-sync-wiki-to-docs:
runs-on: ubuntu-latest
# I have to check '[skip actions]' here because it is NOT supported for the `gollum` event.
if: github.event_name == 'gollum' # && !contains(${{ env.WIKI_COMMIT_MESSAGE }}, '[skip actions]')
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
token: ${{ secrets.CR_PAT }}
ref: ${{ env.default_branch }}
- name: Sync Wiki to Docs
uses: newrelic/wiki-sync-action@master
with:
source: ${{ env.WIKI }}
destination: ${{ env.DOCS }}
token: ${{ secrets.CR_PAT }}
# gitAuthorName: ${{ env.GIT_AUTHOR_NAME }}
# gitAuthorEmail: ${{ env.GIT_AUTHOR_EMAIL }}
branch: ${{ env.default_branch }}
commitMessage: Auto sync ${{ env.WIKI }} to ${{ env.DOCS }} [skip actions]
# Getting a commit message of wiki may not be supported yet.
# - name: Get a commit message of wiki
# uses: actions/github-script@v4
# with:
# script: |
# // console.log('github:', github)
# console.log('context:', context)
# console.log('core:', core)
# console.log('glob:', glob)
# console.log('io:', io)
# console.log('context.payload.repository.owner', context.payload.repository.owner)
# console.log('context.payload.repository.owner.login', context.payload.repository.owner.login)
# console.log('context.payload.repository.name', context.payload.repository.name)
# console.log('context.sha', context.sha)
# owner: context.payload.repository.owner.login,
# repo: context.payload.repository.name,
# commit_sha: context.sha,
# })
# console.log('result:', result)
# show-all-github-context:
# runs-on: ubuntu-latest
# steps:
# - name: Show the github context
# run: |
# echo "ParsedBranch: ${GITHUB_REF#refs/heads/}"
# echo "github: ${{ github }}"
# echo "toJSON(github):"
# echo '${{ toJSON(github) }}'
# echo "github.action: ${{ github.action }}"
# echo "github.action_path: ${{ github.action_path }}"
# echo "github.actor: ${{ github.actor }}"
# echo "github.base_ref: ${{ github.base_ref }}"
# echo "github.event: ${{ github.event }}"
# echo "github.event_name: ${{ github.event_name }}"
# echo "github.event_path: ${{ github.event_path }}"
# echo "github.head_ref: ${{ github.head_ref }}"
# echo "github.job: ${{ github.job }}"
# echo "github.ref: ${{ github.ref }}"
# echo "github.repository: ${{ github.repository }}"
# echo "github.repository_owner: ${{ github.repository_owner }}"
# echo "github.run_id: ${{ github.run_id }}"
# echo "github.run_number: ${{ github.run_number }}"
# echo "github.sha: ${{ github.sha }}"
# echo "github.token: ${{ github.token }}"
# echo "github.workflow: ${{ github.workflow }}"
# echo "github.workspace: ${{ github.workspace }}"
# show-all-env:
# runs-on: ubuntu-latest
# steps:
# - name: Show all environmental variables
# run: |
# echo '${{ toJSON(env) }}'