The recommended way to instrument your GitHub Action is to use one of our Docker Base Images. Using this method, you will not need to made any changes to your Action code, and can often complete an integration with 3 lines in your Dockerfile.
Find the appropriate, matching base image frmo the ActionBlocks namespace to replace the current base image you are using. For “library” base images on DockerHub, this often only requires that you add a actionblocks/ in front of your base image.
For example, if your Dockerfile starts with…
FROM debian:jessie-slim
…then replace this base image with:
FROM actionblocks/debian:jessie-slim
Our base images inherit from the upstream, library base image. We publish the source to our Dockerfiles, and these are built and pushed using a completely automated system.
For ActionBlocks to link the executions and metrics to your Action, you must log in to ActionBlocks.io, and copy the value of your Analytics Token. This should be set as an environment variable in your Dockerfile for the ActionBlocks base image to use.
Analytics Tokens are not secret. They are ok to list publically, if your GitHub Action is open source. Analytics Tokens cannot be used to read any data from your ActionBlocks account, and additional steps are taken to discard any data that was received by someone else using your Analytics Token.
ENTRYPOINTThe ActionBlocks base images have an ENTRYPOINT already set. If your Dockerfile sets a different ENTRYPOINT, it will prevent the base image from executing. If your Dockerfile currently has an ENTRYPOINT directive, simply remove it. The ActionBlocks base images will still execute your entrypoint script, just wrapped with our runtime execution engine.
To enable your image to run both an entrypoint and receive arguments, all of the ActionBlocks base images support setting an environment variable to your true entrypoint. This will default to /entrypoint.sh, so if you are adding your script there, this step can be skipped. If you add your entrypoint script somewhere else, then add the following line to your Dockerfile:
ENV ACTIONBLOCKS_ENTRYPOINT "/path/to/my/entrypoint.sh"