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 }}