-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (61 loc) · 2.17 KB
/
cron.yml
File metadata and controls
78 lines (61 loc) · 2.17 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: cron
on:
schedule:
- cron: '0,30 * * * *'
workflow_dispatch:
concurrency:
group: cron-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
jobs:
deploy-v3:
name: Deploy bundler
runs-on: ubuntu-24.04
steps:
- name: Setup PHP
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f
with:
php-version: '8.5'
- name: Checkout Code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- name: Bundler Data (v3)
run: php bundler.php v3
- name: Deploy JSON for bundler v3
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
FILES=$(
{
git ls-files -m -- 'docs/v3' | grep '\.json$'
git diff --cached --name-only --diff-filter=AM -- 'docs/v3' | grep '\.json$'
git ls-files --others --exclude-standard -- 'docs/v3' | grep '\.json$'
} | sort -u
)
if [ -z "$FILES" ]; then
echo "No JSON changes in docs/v3 to commit."
exit 0
fi
git pull --rebase --autostash
echo "$FILES" | xargs -d '\n' git add --
git commit -m "chore: deploy JSON files to docs/v3 [skip ci]" || {
echo "Nothing to commit."
exit 0
}
git push origin HEAD || (git pull --rebase --autostash && git push origin HEAD)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}