Propagate documentation #1152
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: Propagate documentation | |
on: | |
schedule: | |
- cron: "0 3 * * *" | |
workflow_dispatch: | |
inputs: | |
dry-run: | |
type: boolean | |
description: "Dry run: if checked, run the merge locally but do not push to remote" | |
default: false | |
slack-notifications: | |
type: boolean | |
description: "If checked, send slack notifications when errors occur" | |
default: false | |
jobs: | |
propagate-doc-upwards: | |
runs-on: ubuntu-22.04 | |
strategy: | |
# we want to run the full build on all os: don't cancel running jobs even if one fails | |
fail-fast: false | |
matrix: | |
repo: | |
- bonita-continuous-delivery-doc | |
- bonita-doc | |
- bonita-test-toolkit-doc | |
steps: | |
- name: Checkout bonita-documentation-site | |
uses: actions/checkout@v4 | |
with: | |
path: ./bonita-documentation-site | |
- name: Checkout ${{ matrix.repo }} | |
uses: actions/checkout@v4 | |
with: | |
repository: bonitasoft/${{ matrix.repo }} | |
token: ${{ secrets.GH_TOKEN_DOC_TRIGGER_WF }} # Dedicated token to have 'write' and 'workflow' (needed to update workflows content) permissions (we later push to this repository) | |
path: ./${{ matrix.repo }} | |
# Number of commits to fetch. 0 indicates all history for all branches and tags. | |
fetch-depth: "0" | |
- name: Setup git | |
uses: bonitasoft/git-setup-action@v1 | |
with: | |
keeper-secret-config: ${{ secrets.KSM_CONFIG }} | |
- name: Run propagate doc upwards | |
env: | |
NO_PUSH: ${{ github.event.inputs.dry-run }} | |
REPO_NAME: ${{ matrix.repo }} | |
run: | | |
cd ./${{ matrix.repo }} | |
echo "########################################" | |
echo "Performing the doc propagation" | |
echo "########################################" | |
./.././bonita-documentation-site/scripts/propagate_doc_upwards.bash | |
- name: Send message to Slack channel | |
if: failure() && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.slack-notifications == 'true') ) | |
uses: bonitasoft/notify-slack-action@v1 | |
with: | |
keeper-secret-config: ${{ secrets.KSM_CONFIG }} | |
channel-id: ${{ vars.RD_PLATFORM_SLACK_CHANNEL_ID }} | |
message: | | |
:fire: Propagating documentation upwards failed for repository *${{matrix.repo}}*. | |
@channel *We need someone*! | |
- Add a :fire_extinguisher:if you take the action to resolve the conflicts (only one person is required) | |
- Add a :sweat_drops: when it’s done (and eventually a :party_parrot:) | |
More details on solving the conflicts locally <https://bonitasoft.atlassian.net/wiki/spaces/BS/pages/1181483014/Bonita+documentation+site+content+update#Bonita| there> |