I have a complex transformation that I need to apply whenever a particular file is pushed to GitHub. The transfomation is written in Kotlin (Java) and containerized using Jib. That all works ok. The problem is I don't know how to run the containerized java app from within a GitHub action. The GitHub action is defined as
# This is a workflow that transforms a data file into a json file
name: file-transform
# Controls when the workflow will run
on:
workflow_dispatch:
jobs:
container-test-job:
runs-on: ubuntu-latest
container:
image: docker.io/apigeneration/github-action-test
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
volumes:
- /config:/config
- /data:/data
steps:
- name: Run docker application
run: ???
I have tried all the options I can think of for the run
step but the action fails.
Part of the problem is that I'm not clear how Jib defines the app entry point and so how to define a java
command as part of the run step (I've tried all the options I can think of based on the Jib documentation).
Just running the docker container automatically runs the java app so perhaps there's a better way to invoke it in the action though the container is is a private registry so I have to be able to pass in credentials.
Any help gratefully received.