Skip to content

gha: dummy commit.

gha: dummy commit. #40

Workflow file for this run

name: "build image"
on:
push:
branches-ignore:
- main
- master
tags:
- 'v*'
jobs:
build_cfg:
runs-on: ubuntu-latest
environment: default
outputs:
VERSION_STR: ${{ steps.config_step.outputs.VERSION_STR }}
steps:
- name: "Determine Version"
id: config_step
run: |-
if [[ ${{ github.ref_name }} =~ ^(v)([[:digit:]]+\..*)$ ]]; then
VERSION_STR=${BASH_REMATCH[2]}
else
VER_BUILD=$(date +%H%M)
# limit to only first 3 chars
VER_BUILD=${VER_BUILD:0:3}
# 'strict' semver segments cannot start with 0
VERSION_NUM="$(date +%y).$(date +%-m).$(date +%-d).${VER_BUILD#0}"
# recreate as INT, leaving 0's in place; creates a 'reasonable' 32-bit signed int.
VERSION_INT="$(date +%y)$(date +%m)$(date +%d)${VER_BUILD}"
VERSION_STR=${VERSION_NUM}
fi
echo "VERSION_STR=${VERSION_STR}" >> $GITHUB_OUTPUT
echo "::notice::Version STR=${VERSION_STR}"
#endjob build_cfg
trigger-build:
runs-on: ubuntu-latest
needs: [build_cfg]
environment: default
env:
K8S_PROJECT: pulse-engage-courier
K8S_CONTAINER: courier
SLACK_DEPLOY_MSG:
steps:
- name: "Trigger Container Build"
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.CI_WEBHOOK_TOKEN }}
repository: istresearch/ci-docker
event-type: build-repo
client-payload: |-
{
"repo": {
"name": "${{ github.repository }}",
"ref_type": "${{ github.ref_type }}",
"ref_name": "${{ github.ref_name }}"
},
"image": {
"dockerfile": "Dockerfile",
"arch_allowed": "amd64 arm64",
"name": "${{ github.repository }}",
"tag": "${{ needs.build_cfg.outputs.VERSION_STR }}",
"build_args": [
]
},
"deployment": {
"deploy_flag": "${{ github.ref_type == 'branch' }}",
"k8s_project": "${{ env.K8S_PROJECT }}",
"k8s_container": "${{ env.K8S_CONTAINER }}",
"deploy_msg": "${{ env.SLACK_DEPLOY_MSG }}"
},
"callback": {
"repository": "${{ github.repository }}",
"event_type": "build_image_result",
"error_type": "build_image_error"
}
}
#endjob trigger-build