-
Notifications
You must be signed in to change notification settings - Fork 20
118 lines (105 loc) · 3.67 KB
/
ci.yaml
File metadata and controls
118 lines (105 loc) · 3.67 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
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
---
name: 🚦 CI
on:
pull_request:
branches:
- 'main'
workflow_dispatch:
permissions:
contents: read # minimal required permissions to clone repo
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
build_matrix: ${{ steps.set-build-matrix.outputs.build_matrix }}
steps:
- name: Source checkout
uses: actions/checkout@v6
- name: 'Setup yq'
uses: dcarbone/install-yq-action@v1.3.1
- id: set-build-matrix
run: echo "build_matrix=$(bash matrix.sh build)" >> $GITHUB_OUTPUT
build_ci_container:
name: Build ${{ matrix.platform }} CI container
runs-on: ${{ matrix.runner }}
permissions:
security-events: write
actions: read
contents: read
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.build_matrix) }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Extract server version number
id: extract_server_version
uses: actions/github-script@v9
with:
script: |
const serverVersion = '${{ matrix.server_version }}';
const server_version = serverVersion.split('-')[0];
core.setOutput('server_version', server_version);
- name: Extract db version number
id: extract_db_version
uses: actions/github-script@v9
with:
script: |
const dbVersion = '${{ matrix.db_version }}';
const db_version = dbVersion.split('-')[0];
core.setOutput('db_version', db_version);
- name: Build Ubuntu image
uses: docker/build-push-action@v7
with:
tags: 'ci/openvoxserver:${{ steps.extract_server_version.outputs.server_version }}'
context: openvoxserver
file: openvoxserver/Containerfile
push: false
platforms: linux/${{ matrix.platform }}
build-args: |
OPENVOX_RELEASE=${{ matrix.release }}
OPENVOXSERVER_VERSION=${{ matrix.server_version }}
OPENVOXDB_VERSION=${{ matrix.db_version }}
R10K_VERSION=${{ matrix.r10k_version }}
RUGGED_VERSION=${{ matrix.rugged_version }}
JDK_VERSION=${{ matrix.jdk_version }}
- name: Build Alpine image
uses: docker/build-push-action@v7
with:
tags: 'ci/openvoxserver:${{ steps.extract_server_version.outputs.server_version }}-alpine'
context: openvoxserver
file: openvoxserver/Containerfile.alpine
push: false
build-args: |
OPENVOX_RELEASE=${{ matrix.release }}
OPENVOXSERVER_VERSION=${{ steps.extract_server_version.outputs.server_version }}
OPENVOXDB_VERSION=${{ steps.extract_db_version.outputs.db_version }}
R10K_VERSION=${{ matrix.r10k_version }}
RUGGED_VERSION=${{ matrix.rugged_version }}
JDK_VERSION=${{ matrix.jdk_version }}
tests:
needs:
- build_ci_container
runs-on: ubuntu-latest
name: Test suite
steps:
- run: echo Test suite completed
dependabot:
permissions:
contents: write
name: 'Dependabot auto-merge'
needs:
- tests
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v3.1.0
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}