kanidm/.github/workflows/docker_images.yml
Pando85 7687791466 Merge docker image github actions into unique
Use matrix and Makefile to build both images in the same workflow.

Kanidmd image remove muslc version and come back to SUSE version because
performance problems.

Also fix a typo bug with kanidmd image build on CI.
2020-05-07 12:37:14 +10:00

58 lines
1.2 KiB
YAML

name: release images
on:
push:
branches:
- master
tags:
- v*
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
target: [kanidmd, radiusd]
steps:
- uses: actions/checkout@v2
- name: Run tests
run: make test/${{ matrix.target }}
push:
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
artifact: [kanidmd, radiusd]
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Build image
run: make build/${{ matrix.target }}
- 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/${{ matrix.target }}