2021-10-11 22:13:17 +02:00
|
|
|
name: sync
|
2021-10-09 17:59:21 +02:00
|
|
|
|
2021-10-22 23:35:16 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
2021-10-09 17:59:21 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
docs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-03-23 23:05:43 +01:00
|
|
|
- uses: actions/checkout@v4
|
2021-10-09 17:59:21 +02:00
|
|
|
|
|
|
|
- name: Validate composer.json and composer.lock
|
|
|
|
run: composer validate
|
|
|
|
|
2021-10-22 23:35:16 +02:00
|
|
|
- name: Get Composer Cache Directory
|
2021-10-09 17:59:21 +02:00
|
|
|
id: composer-cache
|
2021-10-22 23:35:16 +02:00
|
|
|
run: |
|
2023-01-11 22:09:08 +01:00
|
|
|
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
2021-10-22 23:35:16 +02:00
|
|
|
|
2024-03-23 23:05:43 +01:00
|
|
|
- uses: actions/cache@v4
|
2021-10-09 17:59:21 +02:00
|
|
|
with:
|
2021-10-22 23:35:16 +02:00
|
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
2021-10-09 17:59:21 +02:00
|
|
|
restore-keys: |
|
2021-10-22 23:35:16 +02:00
|
|
|
${{ runner.os }}-composer-
|
2021-10-09 17:59:21 +02:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
if: steps.composer-cache.outputs.cache-hit != 'true'
|
|
|
|
run: composer install --prefer-dist --no-progress
|
|
|
|
|
|
|
|
- name: Run docgen
|
|
|
|
run: php bin/docgen
|
|
|
|
|
|
|
|
- name: Add & Commit
|
2023-01-12 23:05:07 +01:00
|
|
|
uses: EndBug/add-and-commit@v9
|
2021-10-09 17:59:21 +02:00
|
|
|
with:
|
|
|
|
add: 'docs'
|
2021-10-09 18:04:35 +02:00
|
|
|
message: '[automatic] Update docs with bin/docgen'
|
2023-04-04 11:29:52 +02:00
|
|
|
|
|
|
|
- name: Deploy docs
|
2023-04-04 11:46:01 +02:00
|
|
|
run: |
|
2023-04-04 12:15:21 +02:00
|
|
|
curl --fail-with-body --location --request POST 'https://api.github.com/repos/antonmedv/deployer.org/actions/workflows/deploy-docs.yml/dispatches' \
|
2023-04-04 11:46:01 +02:00
|
|
|
--header "Authorization: Bearer ${MY_GITHUB_TOKEN}" \
|
|
|
|
--header 'Accept: application/vnd.github.v3+json' \
|
|
|
|
--header 'Content-Type: application/json' \
|
|
|
|
--data-raw '{
|
2023-04-04 11:49:50 +02:00
|
|
|
"ref": "master"
|
2023-04-04 11:46:01 +02:00
|
|
|
}'
|
2023-04-04 11:29:52 +02:00
|
|
|
env:
|
2023-04-04 11:46:01 +02:00
|
|
|
MY_GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
|