Generate docker image with uber-jar #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build uber jar | |
on: | |
release: | |
types: [created] | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
uber-jar: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
SQRL_VERSION: [0.5.6, 0.5.7, 0.5.8, 0.5.9, 0.5.10, 0.6.0-SNAPSHOT] | |
FLINK_PROFILE: [flink18, flink19] | |
env: | |
DOCKER_REPO: datasqrl/flink-jar-runner | |
VERSION: ${{ github.event_name == 'release' && github.event.action == 'created' && github.ref_name || 'snapshot' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to Docker Hub | |
if: github.event_name == 'release' && github.event.action == 'created' | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Pull base images | |
run: | | |
docker pull alpine:3 | |
- name: Run Maven Build | |
if: github.event_name == 'release' && github.event.action == 'created' | |
run: | | |
mvn -B versions:set -DnewVersion=${{ env.VERSION }} | |
mvn -B clean install -P${{ matrix.FLINK_PROFILE }} -Dsqrl.version=${{ matrix.SQRL_VERSION }} | |
- name: Build Docker image | |
run: | | |
DOCKER_TAG=$DOCKER_REPO:${{ env.VERSION }}-sqrlv${{ matrix.SQRL_VERSION }}-flink${{ matrix.FLINK_PROFILE }} | |
docker build --build-arg SQRL_VERSION=${{ matrix.SQRL_VERSION }} --build-arg RUNNER_VERSION=${{ env.VERSION }} -t $DOCKER_TAG . | |
docker push $DOCKER_TAG |