mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-27 12:01:49 +03:00
Merge pull request #1265 from acelaya-forks/feature/publish-swagger-workflow
Feature/publish swagger workflow
This commit is contained in:
commit
23c1dadb4c
2 changed files with 51 additions and 1 deletions
2
.github/workflows/docker-image-build.yml
vendored
2
.github/workflows/docker-image-build.yml
vendored
|
@ -9,7 +9,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
50
.github/workflows/publish-swagger-spec.yml
vendored
Normal file
50
.github/workflows/publish-swagger-spec.yml
vendored
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
name: Publish swagger spec
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: The version to generate
|
||||||
|
required: true
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
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
|
||||||
|
if: ${{ github.event.inputs.project != '' }}
|
||||||
|
id: determine_version
|
||||||
|
run: echo "::set-output name=version::$(echo ${{ github.event.inputs.project }})"
|
||||||
|
shell: bash
|
||||||
|
- name: Determine version - from env
|
||||||
|
if: ${{ github.event.inputs.project == '' }}
|
||||||
|
id: determine_version
|
||||||
|
run: echo "::set-output name=version::$(echo ${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.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
|
Loading…
Add table
Reference in a new issue