-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (37 loc) · 1.06 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
name: CI build of all containers
on:
push:
branches:
- main
tags:
- v*
pull_request:
jobs:
push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build hinfo image
run: |
docker build . \
-f Dockerfile.hinfo \
--tag consdb-hinfo \
--label "runnumber=${GITHUB_RUN_ID}"
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Push image
run: |
ID=ghcr.io/${{ github.repository_owner }}/consdb-hinfo
if [[ "${{ github.ref }}" == "refs/pull/"* ]]; then
VERSION=$(echo "${{ github.head_ref }}" | sed -e 's|.*/||')
elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
VERSION=$(echo "${{ github.ref_name }}" | sed -e 's|^v||')
else
VERSION=latest
fi
docker tag consdb-hinfo $ID:$VERSION
docker push $ID:$VERSION