Skip to content

Commit 218f3c2

Browse files
committed
Merge branch 'main-publish-to-separate-website-repo' into v3.3-dev-for-workflow-tests
2 parents e8be491 + 149e06d commit 218f3c2

File tree

2 files changed

+99
-81
lines changed

2 files changed

+99
-81
lines changed

.github/workflows/respec.yaml

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,67 @@
11
name: respec
22

3-
# author: @MikeRalphson
3+
# author: @MikeRalphson, @ralfhandl
44
# issue: https://github.com/OAI/OpenAPI-Specification/issues/1564
55

66
#
7-
# This workflow updates the respec 'pretty' rendered versions of the spec
8-
# on the gh-pages branch when the corresponding markdown files change.
7+
# This workflow creates a pull request for publishing HTML spec versions to the gh-pages site.
98
#
109

1110
# run this manually from main
1211
on:
1312
workflow_dispatch: {}
1413

1514
jobs:
16-
respec:
15+
publish:
1716
if: github.ref == 'refs/heads/main'
1817

1918
runs-on: ubuntu-latest
2019

2120
steps:
22-
- uses: actions/checkout@v5 # checkout main branch
23-
with:
24-
fetch-depth: 0
25-
26-
- uses: actions/setup-node@v5 # setup Node.js
27-
with:
28-
node-version: '20.x'
29-
30-
- name: Install dependencies
31-
run: npm ci
32-
33-
- uses: actions/checkout@v5 # checkout gh-pages branch
34-
with:
35-
ref: gh-pages
36-
path: deploy
37-
38-
- name: run main script
39-
run: scripts/md2html/build.sh
40-
41-
- name: Create Pull Request
42-
uses: peter-evans/create-pull-request@v6
43-
with:
44-
token: ${{ secrets.GITHUB_TOKEN }}
45-
branch: update-respec-version
46-
base: gh-pages
47-
delete-branch: true
48-
path: deploy
49-
labels: Housekeeping
50-
reviewers: earth2marsh,lornajane,mikekistler,miqui,ralfhandl,handrews,karenetheridge
51-
title: Update ReSpec-rendered specification versions
52-
commit-message: Update ReSpec-rendered specification versions
53-
signoff: true
54-
body: |
55-
This pull request is automatically triggered by GitHub action `respec`.
56-
57-
The `versions/*.md` files have changed, so the HTML files are automatically being regenerated.
21+
- name: Generate access token
22+
id: generate-token
23+
uses: actions/create-github-app-token@v1
24+
with:
25+
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
26+
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
27+
owner: OAI
28+
repositories: spec.openapis.org
5829

30+
- uses: actions/checkout@v4 # checkout main branch
31+
with:
32+
fetch-depth: 0
5933

34+
- uses: actions/setup-node@v5 # setup Node.js
35+
with:
36+
node-version: "22.x"
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- uses: actions/checkout@v5 # checkout gh-pages branch
42+
with:
43+
token: ${{ steps.generate-token.outputs.token }}
44+
repository: OAI/spec.openapis.org
45+
ref: main
46+
path: deploy
47+
48+
- name: run main script
49+
run: scripts/md2html/build.sh
50+
51+
- name: Create Pull Request
52+
uses: peter-evans/create-pull-request@v6
53+
with:
54+
token: ${{ steps.generate-token.outputs.token }}
55+
branch: update-openapi-spec-versions
56+
base: main
57+
delete-branch: true
58+
path: deploy
59+
labels: OpenAPI,Specification
60+
reviewers: earth2marsh,lornajane,mikekistler,miqui,ralfhandl,whitlockjc,handrews,karenetheridge
61+
title: OpenAPI - Update ReSpec-rendered specification versions
62+
commit-message: Update ReSpec-rendered specification versions
63+
signoff: true
64+
body: |
65+
This pull request is automatically generated by GitHub action `respec`.
66+
67+
The `versions/*.md` files of the OpenAPI Specification have changed and the corresponding HTML files are regenerated.

.github/workflows/schema-publish.yaml

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,68 @@ name: schema-publish
44
# issue: https://github.com/OAI/OpenAPI-Specification/issues/3715
55

66
#
7-
# This workflow creates a pull request for publishing schema iterations to the gh-pages branch
7+
# This workflow creates a pull request for publishing schema iterations to the gh-pages site.
88
#
99

1010
# run this on push to vX.Y-dev branches or manually
1111
on:
1212
push:
1313
branches:
14-
- 'v[0-9].[0-9]-dev'
14+
- "v[0-9].[0-9]-dev"
1515
paths:
16-
- 'src/schemas/validation/*.yaml'
17-
- 'scripts/schema-publish.sh'
18-
- '.github/workflows/schema-publish.yaml'
16+
- "src/schemas/validation/*.yaml"
17+
- "scripts/schema-publish.sh"
18+
- ".github/workflows/schema-publish.yaml"
1919
workflow_dispatch: {}
2020

2121
jobs:
2222
publish:
23-
2423
runs-on: ubuntu-latest
2524

2625
steps:
27-
- uses: actions/checkout@v5 # checkout main branch
28-
with:
29-
fetch-depth: 0
30-
31-
- uses: actions/setup-node@v5 # setup Node.js
32-
with:
33-
node-version: '22.x'
34-
35-
- name: Install dependencies
36-
run: npm ci
37-
38-
- uses: actions/checkout@v5 # checkout gh-pages branch
39-
with:
40-
ref: gh-pages
41-
path: deploy
42-
43-
- name: run main script
44-
run: scripts/schema-publish.sh
45-
46-
- name: Create Pull Request
47-
uses: peter-evans/create-pull-request@v6
48-
with:
49-
token: ${{ secrets.GITHUB_TOKEN }}
50-
branch: ${{ github.ref_name }}-publish-schema-iteration
51-
base: gh-pages
52-
delete-branch: true
53-
path: deploy
54-
labels: Housekeeping,Schema
55-
reviewers: darrelmiller,webron,earth2marsh,lornajane,mikekistler,miqui,ralfhandl,handrews,karenetheridge
56-
title: '${{ github.ref_name }}: publish OpenAPI schema iterations'
57-
commit-message: New OpenAPI schema iterations
58-
signoff: true
59-
body: |
60-
This pull request is automatically generated by GitHub action `schema-publish`.
61-
The `src/schemas/validation/*.yaml` files have changed and JSON files are automatically generated.
26+
- name: Generate access token
27+
id: generate-token
28+
uses: actions/create-github-app-token@v1
29+
with:
30+
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
31+
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
32+
owner: OAI
33+
repositories: spec.openapis.org
34+
35+
- uses: actions/checkout@v4 # checkout main branch
36+
with:
37+
fetch-depth: 0
38+
39+
- uses: actions/setup-node@v5 # setup Node.js
40+
with:
41+
node-version: "22.x"
42+
43+
- name: Install dependencies
44+
run: npm ci
45+
46+
- uses: actions/checkout@v5 # checkout gh-pages branch
47+
with:
48+
token: ${{ steps.generate-token.outputs.token }}
49+
repository: OAI/spec.openapis.org
50+
ref: main
51+
path: deploy
52+
53+
- name: run main script
54+
run: scripts/schema-publish.sh
55+
56+
- name: Create Pull Request
57+
uses: peter-evans/create-pull-request@v6
58+
with:
59+
token: ${{ steps.generate-token.outputs.token }}
60+
branch: update-openapi-schema-iterations
61+
base: main
62+
delete-branch: true
63+
path: deploy
64+
labels: OpenAPI,Schema
65+
reviewers: earth2marsh,lornajane,mikekistler,miqui,ralfhandl,whitlockjc,handrews,karenetheridge
66+
title: OpenAPI - Update ReSpec-rendered specification versions
67+
commit-message: Update ReSpec-rendered specification versions
68+
signoff: true
69+
body: |
70+
This pull request is automatically generated by GitHub action `schema-publish`.
71+
The `src/schemas/validation/*.yaml` files have changed and JSON files are automatically generated.

0 commit comments

Comments
 (0)