-
Notifications
You must be signed in to change notification settings - Fork 201
110 lines (95 loc) · 3.44 KB
/
sync-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Synchronize Documents
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@v4
- 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@v4
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@v4
with:
repository: daeuniverse/dae-docs
fetch-depth: 0
ref: master
- name: Copy artifacts from build job to local path
uses: actions/[email protected]
with:
name: pre_flight_artifacts
path: docs/
- name: Create commits
run: |
git config user.name 'daebot'
git config user.email '[email protected]'
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 <[email protected]>
committer: daebot <[email protected]>
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