-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (44 loc) · 1.57 KB
/
pull_request.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
---
name: Build OpenStack admin guide
on:
- pull_request
jobs:
# Dynamically define test matrix.
# In openstack-admin-guide CI we want to test various configurations.
# In client admin guide CI we just want to test the actual configuration.
# https://stackoverflow.com/questions/65384420/how-do-i-make-a-github-action-matrix-element-conditional
matrix:
name: Generate test matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- name: Generate test matrix
id: set-matrix
run: |
echo -n "matrix={\"deployment_yaml\": [\"default\"" >> $GITHUB_OUTPUT
if [[ ${{ github.repository }} == 'stackhpc/openstack-admin-guide' ]]; then
for yaml in $(ls .github/workflows/deployment_yaml/); do
echo -n ", \"$yaml\"" >> $GITHUB_OUTPUT
done
fi
echo "]}" >> $GITHUB_OUTPUT
build:
name: Build OpenStack admin guide
needs: matrix
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Python dependencies
run: pip3 install -r requirements.txt
- name: Copy deployment.yml into place
run: cp .github/workflows/deployment_yaml/${{ matrix.deployment_yaml }} source/data/deployment.yml
if: matrix.deployment_yaml != 'default'
- name: Build HTML
run: make html