Sync Documents #1460
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: Sync Documents | |
on: | |
schedule: | |
# Run this workflow automatically once a day at midnight. | |
# * is a special character in YAML so you have to quote this string | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
sync-docs: | |
name: Sync documents from upstream | |
runs-on: ubuntu-latest | |
strategy: | |
# Allow other tests in the matrix to continue if one fails. | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
repo: [lnd, lightning-terminal] | |
include: | |
- repo: lnd | |
org: lightningnetwork | |
src: docs | |
dest: docs/lnd | |
- repo: lightning-terminal | |
org: lightninglabs | |
src: doc | |
dest: docs/lit | |
- repo: loop | |
org: lightninglabs | |
src: docs | |
dest: docs/loop | |
- repo: faraday | |
org: lightninglabs | |
src: docs | |
dest: docs/faraday | |
- repo: pool | |
org: lightninglabs | |
src: docs | |
dest: docs/pool | |
- repo: taproot-assets | |
org: lightninglabs | |
src: docs | |
dest: docs/taproot-assets | |
steps: | |
- name: Checkout docs.lightning.engineering repo | |
uses: actions/checkout@v2 | |
- name: Checkout ${{ matrix.repo }} repo | |
uses: actions/checkout@v2 | |
with: | |
repository: ${{ matrix.org }}/${{ matrix.repo }} | |
path: ${{ matrix.repo }} | |
- name: Pull code differences | |
run: ./scripts/diff.sh ${{ matrix.repo }} ${{ matrix.src }} ${{ matrix.dest }} | |
id: create-diff | |
- name: Create Pull Request | |
if: steps.create-diff.outputs.have_diff == 'true' | |
id: cpr | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
commit-message: update documentation | |
title: Update ${{ matrix.repo }} documentation | |
body: This PR was created to automatically sync ${{ matrix.repo }} documentation. | |
branch: docs-${{ matrix.repo }} | |
author: GitHub <[email protected]> | |
base: master | |
- name: Check outputs | |
if: steps.create-diff.outputs.have_diff == 'true' | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" | |
- name: Merge Pull Request | |
if: steps.create-diff.outputs.have_diff == 'true' | |
uses: juliangruber/merge-pull-request-action@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
number: ${{ steps.cpr.outputs.pull-request-number }} |