Skip to content

Commit 07bb061

Browse files
committed
test deploy github workflow
1 parent c97d5fd commit 07bb061

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: AliECS Control Operator Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'control-operator-v*'
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
defaults:
13+
run:
14+
working-directory: control-operator
15+
16+
jobs:
17+
release:
18+
name: Test, Build & Publish Images
19+
runs-on: ubuntu-24.04
20+
steps:
21+
- uses: actions/checkout@v7
22+
23+
- uses: actions/setup-go@v7
24+
with:
25+
go-version: '1.26.5'
26+
27+
- uses: arduino/setup-protoc@v3
28+
with:
29+
version: '35.1'
30+
repo-token: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Derive version from tag
33+
id: version
34+
run: |
35+
echo "version=${GITHUB_REF_NAME#control-operator-v}" >> "$GITHUB_OUTPUT"
36+
37+
- name: Verify tag matches Makefile VERSION
38+
run: |
39+
MAKEFILE_VERSION=$(sed -n 's/^VERSION ?= //p' Makefile)
40+
if [ "$MAKEFILE_VERSION" != "${{ steps.version.outputs.version }}" ]; then
41+
echo "Tag version (${{ steps.version.outputs.version }}) does not match Makefile VERSION ($MAKEFILE_VERSION)" >&2
42+
exit 1
43+
fi
44+
45+
- name: Run tests
46+
run: make test
47+
48+
- name: Log in to GHCR
49+
uses: docker/login-action@v4
50+
with:
51+
registry: ghcr.io
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Build & push images
56+
run: |
57+
make docker-build docker-push \
58+
TASK_IMG=ghcr.io/aliceo2group/control-operator/task-manager:v${{ steps.version.outputs.version }} \
59+
ENVIRONMENT_IMG=ghcr.io/aliceo2group/control-operator/environment-manager:v${{ steps.version.outputs.version }}

0 commit comments

Comments
 (0)