1414 build-release-and-publish :
1515 runs-on : ubuntu-latest
1616 environment : github-pages
17+ env :
18+ API_FILE_NAME : gridtariffapi-${{ github.ref_name }}.json
1719
1820 steps :
1921 - uses : actions/checkout@v4
@@ -29,62 +31,62 @@ jobs:
2931 - name : Bundle OpenAPI
3032 run : |
3133 mkdir -p dist
32- npx @redocly/cli bundle specification/gridtariffapi.json -o dist/openapi.json
34+ npx @redocly/cli bundle specification/gridtariffapi.json -o dist/${API_FILE_NAME}
3335
3436 - name : Verify info.version matches tag
3537 run : |
36- TAG ="${GITHUB_REF_NAME#v}"
37- FILE_VER=$(jq -r '.info.version' dist/openapi.json )
38- if [ "$FILE_VER" != "$TAG " ]; then
39- echo "info.version ($FILE_VER) does not match tag ($TAG )"
38+ TAG_VER ="${GITHUB_REF_NAME#v}"
39+ FILE_VER=$(jq -r '.info.version' dist/${API_FILE_NAME} )
40+ if [ "$FILE_VER" != "$TAG_VER " ]; then
41+ echo "info.version ($FILE_VER) does not match tag ($TAG_VER )"
4042 exit 1
4143 fi
4244
4345 - name : Lint with Spectral
44- run : spectral lint dist/openapi.json
46+ run : spectral lint dist/${API_FILE_NAME}
4547
4648 - name : Lint with Redocly
47- run : redocly lint dist/openapi.json
49+ run : redocly lint dist/${API_FILE_NAME}
4850
4951 - name : Generate Redoc (static HTML)
50- run : redocly build-docs dist/openapi.json -o dist/redoc.html
52+ run : redocly build-docs dist/${API_FILE_NAME} -o dist/redoc.html
5153
5254 - name : Attach bundled file to Release
5355 uses : softprops/action-gh-release@v2
5456 with :
5557 tag_name : ${{ github.ref_name }}
5658 name : ${{ github.ref_name }}
57- files : dist/openapi.json
59+ files : dist/${API_FILE_NAME}
5860 env :
5961 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6062
61- - name : Prepare Pages site
62- run : |
63- TAG="${GITHUB_REF_NAME}" # e.g. v1.2.3
64- mkdir -p site/${TAG} site/latest
65- cp dist/openapi.json site/${TAG}/openapi .json
66- cp dist/redoc.html site/${TAG}/redoc.html
67- cp site/${TAG}/* site/latest/
63+ # - name: Prepare Pages site
64+ # run: |
65+ # TAG="${GITHUB_REF_NAME}" # e.g. v1.2.3
66+ # mkdir -p site/${TAG} site/latest
67+ # cp dist/${API_FILE_NAME} site/${TAG}/gridtariffapi .json
68+ # cp dist/redoc.html site/${TAG}/redoc.html
69+ # cp site/${TAG}/* site/latest/
6870
69- # tiny index
70- cat > site/index.html <<'HTML'
71- <!doctype html><meta charset="utf-8"><title>API Releases</title>
72- <h1>API Releases</h1>
73- <p><b>Latest</b>:
74- <a href="latest/redoc.html">Redoc</a> ·
75- <a href="latest/openapi.json">openapi.json</a></p>
76- <h2>Versions</h2>
77- <div id="list"></div>
78- <script>
79- // naive directory list (works because we always publish under /vX.Y.Z)
80- const versions = [location.pathname]; // placeholder updated below by Action
81- </script>
82- HTML
71+ # # tiny index
72+ # cat > site/index.html <<'HTML'
73+ # <!doctype html><meta charset="utf-8"><title>API Releases</title>
74+ # <h1>API Releases</h1>
75+ # <p><b>Latest</b>:
76+ # <a href="latest/redoc.html">Redoc</a> ·
77+ # <a href="latest/openapi.json">openapi.json</a></p>
78+ # <h2>Versions</h2>
79+ # <div id="list"></div>
80+ # <script>
81+ # // naive directory list (works because we always publish under /vX.Y.Z)
82+ # const versions = [location.pathname]; // placeholder updated below by Action
83+ # </script>
84+ # HTML
8385
84- - name : Upload Pages artifact
85- uses : actions/upload-pages-artifact@v3
86- with :
87- path : site
86+ # - name: Upload Pages artifact
87+ # uses: actions/upload-pages-artifact@v3
88+ # with:
89+ # path: site
8890
89- - name : Deploy to Pages
90- uses : actions/deploy-pages@v4
91+ # - name: Deploy to Pages
92+ # uses: actions/deploy-pages@v4
0 commit comments