mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-24 04:57:00 +01:00
- Change base builder image to `ekidd/rust-musl-builder` for create static binaries. - Add two flavours: alpine and stand alone binary. - Add makefile commands for build, test and push kanidmd images and refactor previous code. - Add missing things to `.dockerignore`. - Refactor CI to use Makefile.
51 lines
1 KiB
YAML
51 lines
1 KiB
YAML
name: Radius docker image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
tags:
|
|
- v*
|
|
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Run tests
|
|
run: make build/radiusd
|
|
|
|
push:
|
|
needs: test
|
|
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build image
|
|
run: make build/radiusd
|
|
|
|
- name: Log into registry
|
|
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
|
|
|
|
- name: Push image
|
|
run: |
|
|
# Strip git ref prefix from version
|
|
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
|
|
|
# Strip "v" prefix from tag name
|
|
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
|
|
|
# Use Docker `latest` tag convention
|
|
[ "$VERSION" == "master" ] && VERSION=latest
|
|
|
|
VERSION=$VERSION make push/radiusd
|
|
|