|
1 | 1 | name: respec |
2 | 2 |
|
3 | | -# author: @MikeRalphson |
| 3 | +# author: @MikeRalphson, @ralfhandl |
4 | 4 | # issue: https://github.com/OAI/OpenAPI-Specification/issues/1564 |
5 | 5 |
|
6 | 6 | # |
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 spec.openapis.org site. |
9 | 8 | # |
10 | 9 |
|
11 | | -# run this on push to main |
| 10 | +# run this manually or on push to main |
12 | 11 | on: |
13 | 12 | push: |
14 | 13 | branches: |
15 | 14 | - main |
16 | 15 | workflow_dispatch: {} |
17 | 16 |
|
18 | 17 | jobs: |
19 | | - respec: |
| 18 | + publish: |
20 | 19 | if: github.repository == 'OAI/Overlay-Specification' |
21 | | - |
| 20 | + |
22 | 21 | runs-on: ubuntu-22.04 |
23 | 22 |
|
24 | 23 | steps: |
25 | | - - name: Generate access token |
26 | | - id: generate-token |
27 | | - uses: actions/create-github-app-token@v1 |
28 | | - with: |
29 | | - app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }} |
30 | | - private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }} |
31 | | - owner: OAI |
32 | | - repositories: OpenAPI-Specification |
33 | | - |
34 | | - - uses: actions/checkout@v4 # checkout main branch |
35 | | - with: |
36 | | - fetch-depth: 0 |
| 24 | + - name: Generate access token |
| 25 | + id: generate-token |
| 26 | + uses: actions/create-github-app-token@v1 |
| 27 | + with: |
| 28 | + app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }} |
| 29 | + private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }} |
| 30 | + owner: OAI |
| 31 | + repositories: spec.openapis.org |
| 32 | + |
| 33 | + - uses: actions/checkout@v5 # checkout main branch of this repo |
| 34 | + with: |
| 35 | + fetch-depth: 0 |
| 36 | + |
| 37 | + - uses: actions/setup-node@v5 # setup Node.js |
| 38 | + with: |
| 39 | + node-version: "22.x" |
37 | 40 |
|
38 | | - - uses: actions/setup-node@v4 # setup Node.js |
39 | | - with: |
40 | | - node-version: '20.x' |
41 | | - |
42 | | - - name: Install dependencies |
43 | | - run: npm ci |
| 41 | + - name: Install dependencies |
| 42 | + run: npm ci |
44 | 43 |
|
45 | | - - uses: actions/checkout@v4 # checkout gh-pages branch |
46 | | - with: |
47 | | - token: ${{ steps.generate-token.outputs.token }} |
48 | | - repository: OAI/OpenAPI-Specification # TODO: change to OAI/... |
49 | | - ref: gh-pages |
50 | | - path: deploy |
| 44 | + - uses: actions/checkout@v5 # checkout main branch of website repo |
| 45 | + with: |
| 46 | + token: ${{ steps.generate-token.outputs.token }} |
| 47 | + repository: OAI/spec.openapis.org |
| 48 | + ref: main |
| 49 | + path: deploy |
51 | 50 |
|
52 | | - - name: run main script |
53 | | - run: scripts/md2html/build.sh |
| 51 | + - name: run main script |
| 52 | + run: scripts/md2html/build.sh |
54 | 53 |
|
55 | | - - name: Create Pull Request |
56 | | - uses: peter-evans/create-pull-request@v7 |
57 | | - with: |
58 | | - token: ${{ steps.generate-token.outputs.token }} |
59 | | - branch: update-overlay-respec-version |
60 | | - base: gh-pages |
61 | | - delete-branch: true |
62 | | - path: deploy |
63 | | - labels: Housekeeping |
64 | | - reviewers: darrelmiller,webron,earth2marsh,lornajane,mikekistler,miqui,handrews,ralfhandl |
65 | | - title: Overlay - Update ReSpec-rendered specification versions |
66 | | - commit-message: Update ReSpec-rendered specification versions |
67 | | - signoff: true |
68 | | - body: | |
69 | | - This pull request is automatically triggered by GitHub action `respec` in the OAI/Overlay-Specification repo. |
| 54 | + - name: Create Pull Request |
| 55 | + uses: peter-evans/create-pull-request@v7 |
| 56 | + with: |
| 57 | + token: ${{ steps.generate-token.outputs.token }} |
| 58 | + branch: overlay-spec-versions |
| 59 | + base: main |
| 60 | + delete-branch: true |
| 61 | + path: deploy |
| 62 | + labels: Overlay,Specification |
| 63 | + reviewers: earth2marsh,lornajane,mikekistler,miqui,handrews,ralfhandl |
| 64 | + title: Overlay - update ReSpec-rendered specification versions |
| 65 | + commit-message: Update ReSpec-rendered specification versions |
| 66 | + signoff: true |
| 67 | + body: | |
| 68 | + This pull request is automatically generated by GitHub action `respec` in the OAI/Overlay-Specification repo. |
70 | 69 |
|
71 | | - The `versions/*.md` files have changed, so the HTML files are automatically being regenerated. |
| 70 | + The `versions/*.md` files of the OpenAPI Specification have changed and the corresponding HTML files are regenerated. |
0 commit comments