Flink-jar-runner 0.0.3 #56
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: Publish Docker Image | |
on: | |
release: | |
types: [created] | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
SQRL_VERSION: [v0.5.6, v0.5.7, v0.5.8, v0.5.9, v0.5.10, dev] | |
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 gradle:8.6-jdk11 | |
docker pull flink:1.19.1-scala_2.12-java11 | |
- 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 -DskipTests=true | |
- name: Build Docker image | |
working-directory: flink-dockerfile-example | |
run: | | |
DOCKER_TAG=$DOCKER_REPO:${{ env.VERSION }}-sqrl${{ matrix.SQRL_VERSION }} | |
docker build --build-arg SQRL_VERSION=${{ matrix.SQRL_VERSION }} --build-arg GITHUB_ACTOR=${{ github.actor }} --build-arg GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} -t $DOCKER_TAG . | |
- name: Push Docker image | |
if: github.event_name == 'release' && github.event.action == 'created' | |
run: | | |
DOCKER_TAG=$DOCKER_REPO:${{ env.VERSION }}-sqrl${{ matrix.SQRL_VERSION }} | |
docker push $DOCKER_TAG | |
- name: Upload to GitHub Release | |
if: github.event_name == 'release' && github.event.action == 'created' | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: target/flink-jar-runner-${{ env.VERSION }}.jar | |
asset_name: flink-jar-runner-${{ env.VERSION }}.jar | |
asset_content_type: application/java-archive | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
continue-on-error: true |