From 05696960541284559f53e51b1b4af72dd232cabf Mon Sep 17 00:00:00 2001 From: Marco Krikke Date: Fri, 4 Oct 2019 14:37:18 +0200 Subject: [PATCH 1/7] Github Actions: lint API specs on push. --- .github/workflows/lint.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..bc3ae2e --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,20 @@ +name: Lint + +on: push + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - uses: actions/setup-node@v1 + with: + node-version: '10.x' + + - name: Yarn install + run: yarn install + + - name: Lint API specifications + run: yarn lint From 033383c812cb6047096d83c6afb8025cbd944d8a Mon Sep 17 00:00:00 2001 From: Marco Krikke Date: Fri, 4 Oct 2019 14:39:37 +0200 Subject: [PATCH 2/7] Github Actions: build and deploy specs on push to master Build into the /build folder and deploy that folder to the gh-pages branch. --- .github/workflows/gh-pages.yaml | 32 ++++++++++++++++++++++++++++++++ .gitignore | 6 ++++++ package.json | 1 + 3 files changed, 39 insertions(+) create mode 100644 .github/workflows/gh-pages.yaml diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml new file mode 100644 index 0000000..c3af784 --- /dev/null +++ b/.github/workflows/gh-pages.yaml @@ -0,0 +1,32 @@ +name: Deploy to Github Pages + +on: + push: + branches: + - master + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - uses: actions/setup-node@v1 + with: + node-version: '10.x' + + - name: Yarn install + run: yarn install + + - name: Build API docs + run: yarn build + + - name: Deploy to gh-pages branch + uses: peaceiris/actions-gh-pages@v2.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PUBLISH_BRANCH: gh-pages + PUBLISH_DIR: ./build + with: + emptyCommits: false diff --git a/.gitignore b/.gitignore index 56bc926..be1a3ca 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,9 @@ npm-debug.log # IDEA .idea/ + +# Yarn +yarn-error.log + +# Build +build/ diff --git a/package.json b/package.json index c3d6087..f23a198 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "speccy": "0.9.0" }, "scripts": { + "build": "rm -rf build && mkdir build && cp -r docs/* build && cp -r spec build", "lint": "npm-run-all --parallel lint:*", "lint:echo": "speccy lint spec/echo.yaml", "lint:echo-webhooks": "speccy lint spec/echo-webhooks.yaml", From 5da937c8b9184fee76c5bc0953ce53b5b50b67ff Mon Sep 17 00:00:00 2001 From: Marco Krikke Date: Fri, 4 Oct 2019 14:40:30 +0200 Subject: [PATCH 3/7] Refer to OpenAPI spec in the resulting build. --- docs/echo-webhooks.html | 4 ++-- docs/echo.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/echo-webhooks.html b/docs/echo-webhooks.html index 8c674ee..15e7272 100644 --- a/docs/echo-webhooks.html +++ b/docs/echo-webhooks.html @@ -19,7 +19,7 @@ - \ No newline at end of file + diff --git a/docs/echo.html b/docs/echo.html index 708b210..c6302c5 100644 --- a/docs/echo.html +++ b/docs/echo.html @@ -19,7 +19,7 @@ + +