forked from eunomia-bpf/bpf-developer-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 1.97 KB
/
Copy pathtrigger-sync.yml
File metadata and controls
64 lines (56 loc) · 1.97 KB
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
name: Test and trigger downstream tutorial sync
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Checkout tutorial revision
uses: actions/checkout@v7
with:
path: tutorial-source
persist-credentials: false
- name: Checkout website repo
uses: actions/checkout@v7
with:
repository: eunomia-bpf/eunomia.dev
ref: main
path: website
fetch-depth: 0
persist-credentials: false
- name: Stage tutorial revision in website
run: |
rm -rf website/docs/tutorials
mkdir -p website/docs/tutorials
cp -a tutorial-source/src/* website/docs/tutorials/
cp tutorial-source/src/SUMMARY.md website/docs/tutorials/index.md
cp tutorial-source/src/SUMMARY.zh.md website/docs/tutorials/index.zh.md
rm website/docs/tutorials/SUMMARY.md website/docs/tutorials/SUMMARY.zh.md
mkdir -p website/docs/tutorials/imgs
cp -a tutorial-source/imgs/. website/docs/tutorials/imgs/
- uses: actions/setup-node@v6
with:
node-version: "22"
cache: npm
cache-dependency-path: website/app/package-lock.json
- name: Build production static export
working-directory: website/app
env:
NEXT_PUBLIC_SITE_URL: https://eunomia.dev
run: |
npm ci
npm run build
- name: Trigger sync workflow
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'eunomia-bpf/bpf-developer-tutorial'
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.PAT }}
repository: eunomia-bpf/eunomia.dev
event-type: trigger-tutorial-sync
client-payload: '{"source_repo":"eunomia-bpf/bpf-developer-tutorial","source_sha":"${{ github.sha }}"}'