-
-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (112 loc) · 3.79 KB
/
documentation.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Documentation
on:
push:
branches:
- main
- 4.x
workflow_dispatch:
permissions:
id-token: write
pages: write
env:
ARTIFACT: webHelpCASHBOX2-all.zip
CONFIG_JSON_PRODUCT: CASHBOX
CONFIG_JSON_VERSION: 4.x
INSTANCE: docs/cashbox
DOMAIN_NAME: cashbox.city
BUILDER_VERSION: 232.10275
jobs:
build:
name: Build Application
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, simplexml
coverage: xdebug
- name: Configure git
run: git config --global --add safe.directory /github/workspace
- name: Install dependencies
run: composer update --no-progress --no-interaction
- name: Build documentation
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.BUILDER_VERSION }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
retention-days: 7
test:
needs: build
name: Testing
runs-on: ubuntu-latest
steps:
- name: Download docs artifact
uses: actions/download-artifact@v3
with:
name: docs
path: artifacts
- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}
robots:
needs: build
name: Generate robots.txt
runs-on: ubuntu-latest
steps:
- name: Create robots.txt
run: |
touch robots.txt
echo "User-Agent: *" >> robots.txt
echo "Disallow: " >> robots.txt
echo "Host: https://${{ env.DOMAIN_NAME }}" >> robots.txt
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: robots
path: robots.txt
retention-days: 7
deploy-pages:
environment:
name: deploy
url: ${{ steps.deployment.outputs.page_url }}
needs:
- test
- robots
name: Deploy to Pages
runs-on: ubuntu-latest
steps:
- name: Download docs artifact
uses: actions/download-artifact@v3
with:
name: docs
- name: Download robots artifact
uses: actions/download-artifact@v3
with:
name: robots
- name: Unzip artifact
uses: montudor/action-zip@v1
with:
args: unzip -qq ${{ env.ARTIFACT }} -d dir
- name: Move robots
run: |
sudo mv robots.txt dir/robots.txt
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: dir
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2