-
-
Notifications
You must be signed in to change notification settings - Fork 19
123 lines (96 loc) · 3.04 KB
/
vortex-release-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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# This action is used for Vortex maintenance. It will not be used in the scaffolded project.
name: Vortex - Release docs
on:
push:
tags:
- '*'
branches:
- '**release-docs**'
- '**release-installer**'
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
vortex-release-installer:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- name: Install dependencies
run: composer install
working-directory: .vortex/installer
- name: Add version
run: |
TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }}
SHA=${{ github.ref_type == 'branch' && github.sha || '' }}
sed -i "s/\"git-tag-ci\": \"dev\"/\"git-tag-ci\": \"${TAG:-${SHA}}\"/g" box.json
working-directory: .vortex/installer
- name: Build PHAR
run: composer build
working-directory: .vortex/installer
- name: Test PHAR
run: ./build/installer --quiet || exit 1
working-directory: .vortex/installer
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: vortex-installer
path: .vortex/installer/build/installer
vortex-release-docs:
needs: vortex-release-installer
environment:
name: github-pages
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Download installer
uses: actions/download-artifact@v4
with:
name: vortex-installer
- name: Copy installer to docs
run: |
cp ../installer ../.vortex/docs/static/install
php ../.vortex/docs/static/install --version
- name: Check docs up-to-date
run: |
composer --working-dir=.utils install
npm run update-variables
git diff --quiet HEAD || { echo "Docs not up-to-date. Run 'cd .vortex && ahoy update-docs' and commit changes."; git diff; exit 1; }
working-directory: .vortex/docs
- name: Install dependencies
run: npm install
working-directory: .vortex/docs
- name: Build documentation site
run: npm run build
working-directory: .vortex/docs
- name: Upload documentation site
uses: actions/upload-pages-artifact@v3
with:
path: .vortex/docs/build
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4