2021-12-11 13:40:59 +03:00
|
|
|
name: Publish swagger spec
|
|
|
|
|
|
|
|
on:
|
2021-12-11 15:17:45 +03:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
2021-12-11 13:40:59 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2022-08-01 18:13:34 +03:00
|
|
|
runs-on: ubuntu-22.04
|
2021-12-11 13:40:59 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-04-23 13:08:01 +03:00
|
|
|
php-version: ['8.1']
|
2021-12-11 13:40:59 +03:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
2021-12-11 15:17:45 +03:00
|
|
|
- name: Determine version
|
|
|
|
id: determine_version
|
|
|
|
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
|
|
|
|
shell: bash
|
2021-12-11 13:40:59 +03:00
|
|
|
- name: Use PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-version }}
|
|
|
|
tools: composer
|
2022-05-09 09:00:54 +03:00
|
|
|
extensions: openswoole-4.11.1
|
2021-12-11 13:40:59 +03:00
|
|
|
coverage: none
|
|
|
|
- run: composer install --no-interaction --prefer-dist
|
|
|
|
- run: composer swagger:inline
|
2021-12-11 15:17:45 +03:00
|
|
|
- run: mkdir ${{ steps.determine_version.outputs.version }}
|
2022-01-30 11:37:57 +03:00
|
|
|
- run: mv docs/swagger/swagger-inlined.json ${{ steps.determine_version.outputs.version }}/open-api-spec.json
|
2021-12-11 13:40:59 +03:00
|
|
|
- name: Publish spec
|
|
|
|
uses: JamesIves/github-pages-deploy-action@4.1.7
|
|
|
|
with:
|
2021-12-11 14:55:50 +03:00
|
|
|
token: ${{ secrets.OAS_PUBLISH_TOKEN }}
|
2021-12-11 13:40:59 +03:00
|
|
|
repository-name: 'shlinkio/shlink-open-api-specs'
|
|
|
|
branch: main
|
2021-12-11 15:17:45 +03:00
|
|
|
folder: ${{ steps.determine_version.outputs.version }}
|
|
|
|
target-folder: specs/${{ steps.determine_version.outputs.version }}
|
2021-12-11 13:40:59 +03:00
|
|
|
clean: false
|