Skip to content

UnitTests: Fix hex check on metadata git hash #1667

UnitTests: Fix hex check on metadata git hash

UnitTests: Fix hex check on metadata git hash #1667

Workflow file for this run

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
types: [ opened, reopened, synchronize ]
workflow_call:
inputs:
platforms:
description: 'Platforms to build for'
required: false
type: string
latest:
description: 'Tag image as latest'
required: false
type: boolean
default: false
workflow_dispatch:
name: ci-build
env:
REGISTRY: ghcr.io
jobs:
tests:
name: Tests (${{ matrix.name }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: common-unit
dockerfile: docker/Base.Dockerfile
image: test-common
target: test-common
- name: api-integration
dockerfile: docker/API.Dockerfile
image: api-integration-tests
target: integration-test-api
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run ${{ matrix.name }} tests
uses: ./.github/actions/test-app
with:
dockerfile: ${{ matrix.dockerfile }}
image: ${{ matrix.image }}
target: ${{ matrix.target }}
build:
name: Build (${{ matrix.image }})
needs: tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: docker/API.Dockerfile
image: api
- dockerfile: docker/LiveControlGateway.Dockerfile
image: live-control-gateway
- dockerfile: docker/Cron.Dockerfile
image: cron
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build ${{ matrix.image }}
uses: ./.github/actions/build-app
with:
dockerfile: ${{ matrix.dockerfile }}
push: ${{ github.ref_protected && github.event_name != 'pull_request' }}
image: ${{ matrix.image }}
platforms: ${{ inputs.platforms || 'linux/amd64' }}
latest: ${{ inputs.latest || false }}
deploy-dev:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref_type == 'branch' && github.event_name != 'pull_request' && github.ref_name == 'develop' }}
environment: development
steps:
- uses: actions/checkout@v5
with:
sparse-checkout: |
.github
- uses: ./.github/actions/watchtower-update
with:
url: ${{ vars.WATCHTOWER_URL }}
token: ${{ secrets.WATCHTOWER_TOKEN }}
deploy-production:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref_type == 'branch' && github.event_name != 'pull_request' && github.ref_name == 'master' }}
environment: production
steps:
- uses: actions/checkout@v5
with:
sparse-checkout: |
.github
- uses: ./.github/actions/kubernetes-rollout-restart
with:
apiurl: ${{ secrets.KUBERNETES_APIURL }}
token: ${{ secrets.KUBERNETES_TOKEN }}
deployments: ${{ vars.DEPLOYMENT_NAMES }}