Skip to content

Quality Pipeline

Quality Pipeline #24

Workflow file for this run

name: Quality Pipeline
permissions: write-all
on:
pull_request:
branches:
- main # or master, or whatever branch you target with PRs
release:
types:
- created
jobs:
lint:
runs-on: ubuntu-latest
environment:
name: GithubActions
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20' # or your preferred Node version
- name: Install dependencies
run: yarn install
- name: Generate OpenAPI spec
run: yarn generate
# Run Spectral
- uses: stoplightio/spectral-action@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file_glob: 'spec/*.json'
# Extra step that runs only on release
- name: Update Documentation
run: yarn updatePostman
env:
POSTMAN_API_KEY: ${{ secrets.POSTMAN_API_KEY }}
if: github.event_name == 'release'
# Ping to your Kong instance
- name: decK ping
id: decK_ping
uses: ikeike443/decK-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DECK_GROUP_NAME: ${{ secrets.DECK_GROUP_NAME }}
DECK_PAT: ${{ secrets.DECK_PAT }}
with:
command: "ping"
options: "--konnect-runtime-group-name ${{ secrets.DECK_GROUP_NAME }} --konnect-token ${{ secrets.DECK_PAT }}"
if: github.event_name == 'release'
# Generate Config File to sync
- name: decK file openapi2kong
id: deck_file_openapi2kong
uses: ikeike443/decK-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DECK_GROUP_NAME: ${{ secrets.DECK_GROUP_NAME }}
DECK_PAT: ${{ secrets.DECK_PAT }}
with:
command: "file openapi2kong"
options: "--spec ./spec/petStore.json output-file ./kong/petStoreKong.yaml"
if: github.event_name == 'release'
# Sync the state of the files to the Kong instance and update the deployment status in your repo by GitHub Deployment API
- name: decK sync
id: decK_sync
uses: ikeike443/decK-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DECK_GROUP_NAME: ${{ secrets.DECK_GROUP_NAME }}
DECK_PAT: ${{ secrets.DECK_PAT }}
with:
command: "sync -s petStoreKong.yaml"
options: "--konnect-runtime-group-name ${{ secrets.DECK_GROUP_NAME }} --konnect-token ${{ secrets.DECK_PAT }}"
github_token: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'release'