-
Notifications
You must be signed in to change notification settings - Fork 5
121 lines (98 loc) · 2.77 KB
/
build.yaml
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
name: build
on:
workflow_call: {}
push:
branches:
- main
- "v*.*.x"
jobs:
setup:
name: Setup
runs-on: ubuntu-22.04
outputs:
components: ${{ steps.set-matrix.outputs.components }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- id: set-matrix
name: Output component builds
run: |
echo "components=$(ls ./components/ | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
publish-docs:
name: Publish docs
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/main'
permissions:
contents: write
pages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pipenv
- name: Cache tools
uses: actions/cache@v4
with:
path: ./tools
key: doc-tools
- name: Generate docs
run: pip install pipenv && make docs
- name: Upload docs
uses: actions/upload-pages-artifact@v3
with:
path: site/
- name: Publish docs
uses: actions/deploy-pages@v4
publish-component:
name: Publish component
runs-on: ubuntu-22.04
needs: setup
strategy:
matrix:
component: ${{ fromJSON(needs.setup.outputs.components) }}
permissions:
contents: read
packages: write
env:
CONTAINER_REGISTRY: ghcr.io/${{ github.repository_owner }}
REGISTRY_USERNAME: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to ghcr.io
uses: redhat-actions/podman-login@v1
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Cache tools
uses: actions/cache@v4
with:
path: ./tools
key: build-tools
- name: Build and push component
run: make image COMPONENT=${{ matrix.component }} SKIP_GENERATE=true COMPRESS=true PUSH=true