shlink/.github/workflows/publish-swagger-spec.yml

41 lines
1.3 KiB
YAML
Raw Normal View History

name: Publish swagger spec
on:
push:
tags:
- 'v*'
jobs:
build:
2022-08-01 18:13:34 +03:00
runs-on: ubuntu-22.04
strategy:
matrix:
2022-04-23 13:08:01 +03:00
php-version: ['8.1']
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Determine version
id: determine_version
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
shell: bash
- name: Use PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer
extensions: openswoole-4.11.1
coverage: none
- run: composer install --no-interaction --prefer-dist
- run: composer swagger:inline
- 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
- name: Publish spec
uses: JamesIves/github-pages-deploy-action@4.1.7
with:
token: ${{ secrets.OAS_PUBLISH_TOKEN }}
repository-name: 'shlinkio/shlink-open-api-specs'
branch: main
folder: ${{ steps.determine_version.outputs.version }}
target-folder: specs/${{ steps.determine_version.outputs.version }}
clean: false