mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-26 14:53:48 +03:00
Updated publish swagger workflow to be triggered for tags
This commit is contained in:
parent
c48a3a24f7
commit
ec11155c9c
1 changed files with 11 additions and 20 deletions
31
.github/workflows/publish-swagger-spec.yml
vendored
31
.github/workflows/publish-swagger-spec.yml
vendored
|
@ -1,14 +1,9 @@
|
||||||
name: Publish swagger spec
|
name: Publish swagger spec
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
push:
|
||||||
inputs:
|
tags:
|
||||||
version:
|
- 'v*'
|
||||||
description: The version to generate
|
|
||||||
required: true
|
|
||||||
# push:
|
|
||||||
# tags:
|
|
||||||
# - 'v*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -19,10 +14,10 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
# - name: Determine version
|
- name: Determine version
|
||||||
# id: determine_version
|
id: determine_version
|
||||||
# run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
|
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
|
||||||
# shell: bash
|
shell: bash
|
||||||
- name: Use PHP
|
- name: Use PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
|
@ -32,18 +27,14 @@ jobs:
|
||||||
coverage: none
|
coverage: none
|
||||||
- run: composer install --no-interaction --prefer-dist
|
- run: composer install --no-interaction --prefer-dist
|
||||||
- run: composer swagger:inline
|
- run: composer swagger:inline
|
||||||
# - run: mkdir ${{ steps.determine_version.outputs.version }}
|
- 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
|
||||||
# - run: mv docs/swagger/swagger-inline.json ${{ steps.determine_version.outputs.version }}/oas.json
|
|
||||||
- run: mv docs/swagger/swagger-inlined.json ${{ github.event.inputs.version }}/oas.json
|
|
||||||
- name: Publish spec
|
- name: Publish spec
|
||||||
uses: JamesIves/github-pages-deploy-action@4.1.7
|
uses: JamesIves/github-pages-deploy-action@4.1.7
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.OAS_PUBLISH_TOKEN }}
|
token: ${{ secrets.OAS_PUBLISH_TOKEN }}
|
||||||
repository-name: 'shlinkio/shlink-open-api-specs'
|
repository-name: 'shlinkio/shlink-open-api-specs'
|
||||||
branch: main
|
branch: main
|
||||||
# folder: ${{ steps.determine_version.outputs.version }}
|
folder: ${{ steps.determine_version.outputs.version }}
|
||||||
folder: ${{ github.event.inputs.version }}
|
target-folder: specs/${{ steps.determine_version.outputs.version }}
|
||||||
# target-folder: specs/${{ steps.determine_version.outputs.version }}
|
|
||||||
target-folder: specs/${{ github.event.inputs.version }}
|
|
||||||
clean: false
|
clean: false
|
||||||
|
|
Loading…
Reference in a new issue