Skip to content

Commit e5de49a

Browse files
authored
Merge pull request #869 from DuendeSoftware/pg/docs-ci-cd-workflow
Add Docs CI CD Workflow
2 parents 396eb4b + 635a332 commit e5de49a

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/docs-ci-cd.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: docs/ci-cd
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, synchronize, reopened, closed, labeled]
7+
push:
8+
branches: [main]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build-deploy:
15+
name: Build and Deploy
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Generate token
19+
id: generate_token
20+
uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e
21+
with:
22+
app-id: ${{ vars.DUENDE_GITHUB_BOT_APP_ID }}
23+
private-key: ${{ secrets.DUENDE_GITHUB_BOT_APP_PRIVATE_KEY }}
24+
owner: ${{ github.repository_owner }}
25+
repositories: ${{ secrets.OPS_REPOSITORY_NAME }}
26+
27+
- name: Trigger Ops Workflow
28+
uses: actions/github-script@v8
29+
with:
30+
github-token: ${{ steps.generate_token.outputs.token }}
31+
script: |
32+
await github.rest.repos.createDispatchEvent({
33+
owner: '${{ github.repository_owner }}',
34+
repo: '${{ secrets.OPS_REPOSITORY_NAME }}',
35+
event_type: 'trigger-workflow',
36+
client_payload: {
37+
"source_repo": "${{ github.repository }}",
38+
"ref": "${{ github.ref }}",
39+
"sha": "${{ github.sha }}",
40+
"pr_number": "${{ github.event.pull_request.number }}",
41+
"pr_label": "${{ github.event.label.name }}",
42+
"event": "${{ github.event.action}}"
43+
}
44+
});

0 commit comments

Comments
 (0)