-
Notifications
You must be signed in to change notification settings - Fork 169
33 lines (27 loc) · 1.04 KB
/
docker.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
name: Build Development Docker image
on:
workflow_dispatch:
push:
env:
IMAGE_TAG: ${{ github.ref_name }}
IMAGE_SHA: ${{ github.sha }}
OC_REGISTRY: ghcr.io
REGISTRY_URL: "ghcr.io/freetakteam/freetakserver"
jobs:
build_docker_image:
name: Docker Build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Build the container image
# can this be converted to podman at some point to be more foss?
run: |
SANITIZED_TAG="$(echo ${IMAGE_TAG//[^[:alnum:]]/_} | tr '[:upper:]' '[:lower:]' )"
docker build . --file Dockerfile --tag $REGISTRY_URL:$SANITIZED_TAG --tag $REGISTRY_URL:$IMAGE_SHA --label "runnumber=${GITHUB_RUN_ID}"
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login $OC_REGISTRY -u $ --password-stdin
- name: Push image to registry
run: |
SANITIZED_TAG="$(echo ${IMAGE_TAG//[^[:alnum:]]/_} | tr '[:upper:]' '[:lower:]' )"
docker push $REGISTRY_URL:$SANITIZED_TAG
docker push $REGISTRY_URL:$IMAGE_SHA