-
-
Notifications
You must be signed in to change notification settings - Fork 48
50 lines (41 loc) · 1.57 KB
/
build-api-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Build API Reference
on:
schedule:
- cron: '0 7 * * *'
workflow_dispatch:
env:
DOCS_REPOSITORY: cachethq/docs
DOCS_BRANCH: 3.x
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
- name: Install dependencies
run: composer install
- name: Install Scramble PRO
run: |
composer config repositories.scramble-pro '{"type": "composer", "url": "https://satis.dedoc.co"}'
composer config http-basic.satis.dedoc.co ${{ secrets.SCRAMBLE_USERNAME }} ${{ secrets.SCRAMBLE_KEY }}
composer require dedoc/scramble-pro:0.7.0-alpha.1 --dev
- name: Checkout documentation repository
uses: actions/checkout@v4
with:
token: ${{ secrets.DOCS_API_TOKEN }}
repository: ${{ env.DOCS_REPOSITORY }}
ref: ${{ env.DOCS_BRANCH }}
path: 'docs-repository'
- name: Build API docs
run: php vendor/bin/testbench scramble:export --path=docs-repository/api-reference/openapi.json
- name: Commit and push generated specification
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Generated API specification from ${{ github.repository }}/${{ github.ref}}@${{ github.sha }}"
repository: "docs-repository"