-
Notifications
You must be signed in to change notification settings - Fork 25
134 lines (114 loc) · 3.69 KB
/
dist-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
124
125
126
127
128
129
130
131
132
133
134
name: Rebuild dist-docs
on:
workflow_dispatch:
# Build every week on Monday 00:00
schedule:
- cron: '0 0 * * 1'
jobs:
build-linux:
if: github.repository_owner == 'ovn-org'
name: linux ${{ join(matrix.*, ' ') }}
container: fedora:latest
runs-on: ubuntu-22.04
strategy:
max-parallel: 1
fail-fast: false
matrix:
include:
- branch: main
- branch: branch-22.03
- branch: branch-23.06
- branch: branch-23.09
- branch: branch-24.03
- branch: branch-24.09
steps:
- name: install dependencies
run: dnf install -y dnf-plugins-core ghostscript git man
- name: checkout ovn-website
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: 'ovn-website'
ref: ${{ github.ref }}
- name: checkout OVN
uses: actions/checkout@v4
with:
repository: 'ovn-org/ovn'
path: 'ovn'
ref: ${{ matrix.branch }}
submodules: recursive
- name: install build dependencies
run: |
sed -e 's/@VERSION@/0.0.1/' rhel/ovn-fedora.spec.in \
> /tmp/ovn.spec
dnf builddep -y /tmp/ovn.spec
working-directory: ovn
- name: configure OvS
run: ./boot.sh && ./configure
working-directory: ovn/ovs
- name: make dist OvS
run: make -j4 dist
working-directory: ovn/ovs
- name: configure OVN
run: ./boot.sh && ./configure
working-directory: ovn
- name: make dist-docs OVN
run: make -j4 dist-docs
working-directory: ovn
- name: archive dist-docs
run: tar -czvf /tmp/dist-docs.tgz dist-docs
working-directory: ovn
- name: replace dist-docs content
if: ${{ success() }}
run: |
DOCS_DIR="dist-docs"
[ "${{ matrix.branch }}" == "main" ] || DOCS_DIR="${DOCS_DIR}-${{ matrix.branch }}"
rm -rf ${DOCS_DIR}
mkdir -v ${DOCS_DIR}
tar xzvf /tmp/dist-docs.tgz --strip-components=1 -C ${DOCS_DIR}
working-directory: ovn-website/src/static/support
- name: push updated dist-docs
run: |
if [ -n "$(git status --porcelain -unormal)" ]; then
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git add src/static/support
git commit -m "Update OVN ${{ matrix.branch }} manpages"
git push
else
echo "No changes needed for ${{ matrix.branch }} manpages"
fi
working-directory: ovn-website
- name: copy logs on failure
if: failure() || cancelled()
run: |
# upload-artifact doesn't work well enough with wildcards.
# So, we're just archiving everything here to avoid any issues.
mkdir logs
cp config.log ./logs/
tar -czvf logs.tgz logs/
working-directory: ovn
- name: upload logs on failure
if: failure() || cancelled()
uses: actions/upload-artifact@v4
with:
name: logs-linux-${{ join(matrix.*, '-') }}
path: ovn/logs.tgz
- name: upload dist-docs on failure
if: failure() || cancelled()
uses: actions/upload-artifact@v4
with:
name: dist-docs-${{ join(matrix.*, '-') }}
path: /tmp/dist-docs.tgz
push-changes:
if: github.repository_owner == 'ovn-org' && github.ref_name == 'main'
name: Push changes
runs-on: ubuntu-latest
needs: [build-linux]
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: checkout ovn-website
uses: actions/checkout@v4
- name: Trigger publish
run: gh workflow run publish.yml --ref main