Skip to content

Commit 5671328

Browse files
committed
Automatically sync documentations
1 parent 54a3291 commit 5671328

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/sync-doc.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: 'Sync Documentation'
3+
4+
on:
5+
# Allow manual trigger
6+
push:
7+
branches:
8+
- 'automatic-sync-doc'
9+
workflow_dispatch:
10+
# Run weekly on Saturdays at 10 AM UTC (weekend schedule)
11+
schedule:
12+
- cron: '0 10 * * 6'
13+
14+
jobs:
15+
auto-build:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
env:
21+
APP_ENV: production
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 18
32+
cache: npm
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Build preparation
38+
env:
39+
APP_ENV: production
40+
AMP_DOC_TOKEN: ${{ secrets.AMP_DOC_TOKEN }}
41+
run: |
42+
npx gulp buildPrepare
43+
44+
- name: Create Pull Request if changes exist
45+
uses: peter-evans/create-pull-request@v5
46+
with:
47+
token: ${{ secrets.GITHUB_TOKEN }}
48+
commit-message: 'Automatic documentation sync [skip ci]'
49+
title: 'Automatic documentation sync - ${{ github.run_number }}'
50+
body: |
51+
🤖 **Automatic documentation sync**
52+
53+
This PR contains updates generated by the weekly automated build process (`npm run build:prod`).
54+
55+
**Schedule:** Every Saturday at 10 AM UTC
56+
**Workflow Run:** [${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
57+
58+
Please review the changes.
59+
branch: auto-build-${{ github.run_number }}
60+
delete-branch: true

0 commit comments

Comments
 (0)