-
-
Notifications
You must be signed in to change notification settings - Fork 29
76 lines (63 loc) · 2.48 KB
/
Copy pathpublish-docs.yml
File metadata and controls
76 lines (63 loc) · 2.48 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
name: Publish Documentation
on:
push:
paths: [ 'docs/**' ]
branches: [ develop ]
jobs:
build:
runs-on: ubuntu-latest
environment:
name: Domain Watchdog Documentation
url: https://domainwatchdog.eu
steps:
- name: Checkout source
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring, xml, intl, curl, iconv, pdo_pgsql, sodium, zip, http
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader
- name: Generate Swagger JSON
run: bin/console api:openapi:export --output=docs/swagger_docs.json
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24
- name: Install dependencies
run: npm install --global yarn && yarn install
working-directory: docs
- name: Build Astro site
run: yarn run build
working-directory: docs
- name: Clean target folder on server
uses: appleboy/ssh-action@v1
with:
host: dw1.srv.domainwatchdog.eu
port: 2004
username: deploy
key: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
script: |
rm -rf /var/www/domainwatchdog.eu/*
- name: Upload build via SCP
uses: appleboy/scp-action@master
with:
host: dw1.srv.domainwatchdog.eu
port: 2004
username: deploy
key: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
source: "docs/dist/*"
target: /var/www/domainwatchdog.eu/
overwrite: true
debug: true
strip_components: 2