2021-12-11 04:40:59 -06:00
|
|
|
name: Publish swagger spec
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
version:
|
|
|
|
description: The version to generate
|
|
|
|
required: true
|
2021-12-11 04:53:18 -06:00
|
|
|
# push:
|
|
|
|
# tags:
|
|
|
|
# - 'v*'
|
2021-12-11 04:40:59 -06:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
php-version: ['8.0']
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
2021-12-11 05:18:55 -06:00
|
|
|
# - name: Determine version
|
2021-12-11 04:53:18 -06:00
|
|
|
# id: determine_version
|
|
|
|
# run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
|
|
|
|
# shell: bash
|
2021-12-11 04:40:59 -06:00
|
|
|
- name: Use PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-version }}
|
|
|
|
tools: composer
|
|
|
|
extensions: openswoole-4.8.1
|
|
|
|
coverage: none
|
|
|
|
- run: composer install --no-interaction --prefer-dist
|
|
|
|
- run: composer swagger:inline
|
2021-12-11 05:18:55 -06:00
|
|
|
# - run: mkdir ${{ steps.determine_version.outputs.version }}
|
|
|
|
- run: mkdir ${{ github.event.inputs.version }}
|
|
|
|
# - run: mv docs/swagger/swagger-inline.json ${{ steps.determine_version.outputs.version }}/oas.json
|
2021-12-11 05:35:34 -06:00
|
|
|
- run: mv docs/swagger/swagger-inlined.json ${{ github.event.inputs.version }}/oas.json
|
2021-12-11 04:40:59 -06:00
|
|
|
- name: Publish spec
|
|
|
|
uses: JamesIves/github-pages-deploy-action@4.1.7
|
|
|
|
with:
|
2021-12-11 05:55:50 -06:00
|
|
|
token: ${{ secrets.OAS_PUBLISH_TOKEN }}
|
2021-12-11 04:40:59 -06:00
|
|
|
repository-name: 'shlinkio/shlink-open-api-specs'
|
|
|
|
branch: main
|
2021-12-11 05:18:55 -06:00
|
|
|
# folder: ${{ steps.determine_version.outputs.version }}
|
|
|
|
folder: ${{ github.event.inputs.version }}
|
2021-12-11 06:09:39 -06:00
|
|
|
# target-folder: specs/${{ steps.determine_version.outputs.version }}
|
|
|
|
target-folder: specs/${{ github.event.inputs.version }}
|
2021-12-11 04:40:59 -06:00
|
|
|
clean: false
|