-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create sync-docs.yml * feat(ci): add sync-docs.yml * patch(ci/check-docs): add event-driven trigger * ci: watch changes made in sync-docs.yml * ci: re-arrange the order of steps * ci(check-docs): disable all auto trigger * ci(sync-docs): update author and commiter to daebot * fix: apply subtle changes * ci: apply subtle changes * ci: test copy functionality * patch: fix proper naming * chore: remove dummy line * ci: watch changes of example.dae * chore(issue_template): remove unnecessary marks
- Loading branch information
Showing
4 changed files
with
119 additions
and
13 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
name: Synchronize document | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- 'ci/**' | ||
- 'release/**' | ||
tags: | ||
- 'v*' | ||
paths: | ||
- "README*.md" | ||
- "docs/**" | ||
- "example.dae" | ||
- "package.json" | ||
- ".autocorrectrc" | ||
- ".markdownlint-cli2.jsonc" | ||
- '.github/workflows/sync-docs.yml' | ||
|
||
jobs: | ||
check-docs: | ||
name: Check document | ||
uses: ./.github/workflows/check-docs.yml | ||
|
||
replicate-config: | ||
needs: [check-docs] | ||
name: Replicate relevant document | ||
runs-on: ubuntu-latest | ||
outputs: | ||
git_sha_long: ${{ steps.export.outputs.git_sha_long }} | ||
git_sha_short: ${{ steps.export.outputs.git_sha_short }} | ||
git_commit_msg: ${{ steps.export.outputs.git_commit_msg }} | ||
git_run_number: ${{ steps.export.outputs.git_run_number }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get metadata from HEAD sha | ||
id: export | ||
run: | | ||
echo "git_sha_long=${{ github.sha }}" >> $GITHUB_OUTPUT | ||
echo "git_sha_short=$(echo ${{ github.sha }} | cut -c1-6)" >> $GITHUB_OUTPUT | ||
echo "git_commit_msg=$(git log --format=%s -n 1 ${{ github.sha }})" >> $GITHUB_OUTPUT | ||
echo "git_run_number=${{ github.run_number }}" >> $GITHUB_OUTPUT | ||
- name: Generate artifacts | ||
run: | | ||
python3 hack/ci/config-doc-generator.py | ||
- name: Export artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pre_flight_artifacts | ||
path: | | ||
./docs/sync/*.md | ||
sync-to-dae-docs: | ||
needs: [replicate-config] | ||
name: Synchronize changes to dae-docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout to daeuniverse/dae-docs | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: daeuniverse/dae-docs | ||
fetch-depth: 0 | ||
ref: master | ||
|
||
- name: Copy artifacts from build job to local path | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: pre_flight_artifacts | ||
path: docs/ | ||
|
||
- name: Create commits | ||
run: | | ||
git config user.name 'daebot' | ||
git config user.email 'daebot@users.noreply.github.com' | ||
git ls-files --others --exclude-standard -- "*.md" | ||
git add "*.md" | ||
git commit -m "ci(auto-release): push proposed documentation changes from upstream dae project" | ||
- name: Create Pull Request | ||
id: create_pr | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
author: daebot <dae@v2raya.org> | ||
committer: daebot <dae@v2raya.org> | ||
token: ${{ secrets.GH_TOKEN }} | ||
signoff: false | ||
branch: automated-pr-sync | ||
delete-branch: true | ||
title: 'ci(auto-release): sync changes from upstream' | ||
body: | | ||
## Summary | ||
Update documentation - Auto-generated by [${{ github.repository }} #${{ needs.replicate-config.outputs.git_run_number }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) @daebot | ||
Commit message: ${{ needs.replicate-config.outputs.git_commit_msg }} | ||
## Context | ||
🏗 daeuniverse/dae(${{ needs.replicate-config.outputs.git_sha_short }}): Build [#${{ needs.replicate-config.outputs.git_run_number }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) succeeded! | ||
labels: | | ||
automated-pr | ||
assignees: daebot | ||
team-reviewers: | | ||
docs | ||
draft: false | ||
|