330 improve spark integration with notebook #262
Workflow file for this run
This file contains 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 Examples | |
# Controls when the workflow will run | |
on: | |
push: | |
paths: | |
- 'examples/**' | |
pull_request: | |
paths: | |
- 'examples/**' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
deploy-example: | |
type: choice | |
description: Example to Deploy | |
options: | |
- None | |
- WordCount | |
jobs: | |
build-examples: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
# Runs a set of commands using the runners shell | |
- name: Maven Package | |
run: | | |
cd examples/[email protected]/word-count | |
mvn clean package | |
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
timestamp=$(date +"%Y%m%d%H%M%S") | |
version_with_timestamp="${version}-${timestamp}" | |
echo "Version with timestamp: $version_with_timestamp" | |
echo "VERSION=$version" >> $GITHUB_ENV | |
echo "VERSION_WITH_TIMESTAMP=$version_with_timestamp" >> $GITHUB_ENV | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Docker Build & Push | |
run: | | |
cd examples/[email protected]/word-count | |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/word-count:$VERSION_WITH_TIMESTAMP --build-arg VERSION=$VERSION . | |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/word-count:$VERSION_WITH_TIMESTAMP | |