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
|
|
|
|
- name: Determine version - from input
|
|
|
|
id: determine_version
|
2021-12-11 05:11:22 -06:00
|
|
|
run: echo "::set-output name=version::${{ github.event.inputs.version }}"
|
2021-12-11 04:40:59 -06:00
|
|
|
shell: bash
|
2021-12-11 04:53:18 -06:00
|
|
|
# - name: Determine version - from env
|
|
|
|
# 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
|
|
|
|
- run: mkdir ${{ steps.determine_version.outputs.version }}
|
|
|
|
- run: mv docs/swagger/swagger-inline.json ${{ steps.determine_version.outputs.version }}/oas.json
|
|
|
|
- name: Publish spec
|
|
|
|
uses: JamesIves/github-pages-deploy-action@4.1.7
|
|
|
|
with:
|
|
|
|
repository-name: 'shlinkio/shlink-open-api-specs'
|
|
|
|
branch: main
|
|
|
|
folder: ${{ steps.determine_version.outputs.version }}
|
|
|
|
target-folder: specs
|
|
|
|
clean: false
|