mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 20:47:01 +01:00
58 lines
1.2 KiB
Plaintext
58 lines
1.2 KiB
Plaintext
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:
|
|
target: [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 }}
|
|
|