Skip to contents

Deploy Docker Image Workflow

This GitHub Actions workflow automates the deployment of Docker images based on changes in the DESCRIPTION file. It is designed to run on pushes to the main branch, manual triggers, and on a schedule (every day at midnight UTC on Wednesdays and Sundays). Note : this workflow is using InsightsEngineering R image creator action.

Matrix

  • R versions are specified in the matrix for parallel execution.
matrix:
  r_version: ['release', 'devel', 'oldrel']

Workflow Structure

The workflow consists of three jobs: get_old_release, deploy-image, and store_deps.

get_old_release Job

This job retrieve the R version corresponding to “oldrelease”. It contains only a simple step parsing OLD_RELEASE env variable. This variable is set up manually (checking actual release version of R and taking the previous version). Another workflow (with cron workflow) is running in admiralci to check if a new release of R is available (this allow admiralci developers to check if they need to update OLD_RELEASE variable).

Steps
  1. get old release: Retrieves value of env variable OLD_RELEASE, and store it in $GITHUB_OUTPUT variables.

deploy-image Job

This job deploys Docker images based on the specified configurations. By the end of this job, the following images will be created and stored in admiralci ghcr (github container registry) :

  • admiralci-release
  • admiralci-devel
  • admiralci-oldrel

The images are available in admiralci ghcr.

Steps
  1. Checkout repo: Checks out the current repository.
  2. Set image specs: Retrieves package name, R version, and other specifications.
  3. Call deploy docker image action: Invokes the Docker image deployment action for each R version.

store_deps Job

This job create admiralci release artifacts, for each docker image ()

Steps
  1. Store deps into CSV file: Retrieves installed packages for each image, and stores them in a CSV file.
  2. Upload deps.csv artifact: Uploads the CSV file containing dependencies as an artifact.
  3. Delete current release existing artifacts Delete admiralci existing release artifacts (this is necessary before the step bellow)
  4. Upload SBOM to release 🔼 Upload admiralci release artifacts

The output artifacts are available in admiralci latest release. These artifacts allow developers to retrieve versions of installed dependencies in the workflows, to ensure reproducibility locally. But note that dependencies artifacts are also produced during R CMD CHECKS workflow.

Inputs

Triggers

  • push: Triggered on pushes to the main branch with changes in DESCRIPTION.
  • workflow_dispatch: Allows manual triggering of the workflow.
  • schedule: Runs every day at midnight UTC on Wednesdays and Sundays.

Permissions

  • write-all: Provides write permissions for various operations.

Concurrency

Concurrency settings are specified to manage concurrent workflow runs effectively.