-
-
Notifications
You must be signed in to change notification settings - Fork 10
104 lines (86 loc) · 4.41 KB
/
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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Documentation
on:
push:
branches:
- main
workflow_run:
workflows:
- update
types:
- completed
workflow_dispatch:
repository_dispatch:
types:
- docs
permissions: write-all
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv
coverage: xdebug
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
npm i
composer install
- name: Updating the available localizations page
run: php app/bin/available-locales.php
- name: Clearing translation statuses
run: |
rm -rf docs/statuses/attributes
rm -rf docs/statuses/http-statuses
rm -rf docs/statuses/lang
mkdir docs/statuses/attributes
mkdir docs/statuses/http-statuses
mkdir docs/statuses/lang
- name: Download repositories
run: |
git clone --no-tags --single-branch https://github.com/Laravel-Lang/attributes.git tmp/attributes
git clone --no-tags --single-branch https://github.com/Laravel-Lang/http-statuses.git tmp/http-statuses
git clone --no-tags --single-branch https://github.com/Laravel-Lang/lang.git tmp/lang
- name: Move translation statuses
run: |
mv -f tmp/attributes/docs/status.md docs/statuses/attributes/index.md
mv -f tmp/http-statuses/docs/status.md docs/statuses/http-statuses/index.md
mv -f tmp/lang/docs/status.md docs/statuses/lang/index.md
mv -f tmp/attributes/docs/statuses docs/statuses/attributes/statuses
mv -f tmp/http-statuses/docs/statuses docs/statuses/http-statuses/statuses
mv -f tmp/lang/docs/statuses docs/statuses/lang/statuses
- name: Resolve page names
run: |
sed -i 's/# Completion Status/# Completion Status: Attributes/g' docs/statuses/attributes/index.md
sed -i 's/# Completion Status/# Completion Status: HTTP Statuses/g' docs/statuses/http-statuses/index.md
sed -i 's/# Completion Status/# Completion Status: Lang/g' docs/statuses/lang/index.md
- name: Resolve navigation links
run: |
sed -i 's/<\/table>/<\/table>\n\n[ [go back](..\/index.md) | [to top](\#) ]/g' docs/statuses/attributes/index.md
sed -i 's/<\/table>/<\/table>\n\n[ [go back](..\/index.md) | [to top](\#) ]/g' docs/statuses/http-statuses/index.md
sed -i 's/<\/table>/<\/table>\n\n[ [go back](..\/index.md) | [to top](\#) ]/g' docs/statuses/lang/index.md
sed -i 's/..\/status.md/..\/index.md/g' docs/statuses/attributes/statuses/*
sed -i 's/..\/status.md/..\/index.md/g' docs/statuses/http-statuses/statuses/*
sed -i 's/..\/status.md/..\/index.md/g' docs/statuses/lang/statuses/*
- name: Build VuePress site
run: npm run build
env:
VITE_APP_ALGOLIA_APP_ID: ${{ secrets.VITE_APP_ALGOLIA_APP_ID }}
VITE_APP_ALGOLIA_API_KEY: ${{ secrets.VITE_APP_ALGOLIA_API_KEY }}
VITE_APP_ALGOLIA_INDEX_NAME: ${{ secrets.VITE_APP_ALGOLIA_INDEX_NAME }}
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v4.0.0
with:
target_branch: gh-pages
build_dir: docs/.vuepress/dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}