Skip to content

fixing path

fixing path #78

name: Create Docker image and publish to GH Packages
on:
push:
tags:
- "*" # only when a new tag is pushed ("v*"?)
env:
DOCKER_REGISTRY: ghcr.io # where to register the image
REPO_PATH: github.com:furrer-lab/devel-abn.git
# Set the path to the DESCRIPTION file in the R package you want to target
DESCRIPTION_FILE: ${{ vars.DESCRIPTION_FILE || './DESCRIPTION' }}
JAGS: JAGS-4.3.2
jobs:
build-and-push:
runs-on: ubuntu-22.04
permissions: # for `GITHUB_TOKEN`
contents: read
packages: write
strategy:
fail-fast: false
matrix:
target-os: ['debian', 'fedora']
compiler: ['gcc', 'clang']
r-version: ['devel', 'release', 'patched']
exclude:
- target-os: 'fedora'
- target-os: 'fedora'
r-version: 'release'
- target-os: 'fedora'
r-version: 'patched'
- compiler: 'clang'
r-version: 'patched'
- compiler: 'clang'
r-version: 'release'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract tags and labels
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
# TODO: set a proper name of the image (same as in context below)
images: ${{ env.DOCKER_REGISTRY}}/${{ format('{0}/{1}/{2}/{3}/abn', github.repository, matrix.target-os, matrix.compiler, matrix.r-version ) }}
tags: | # set Docker tags to git tags
type=semver,pattern={{version}}
- name: Write the ssh key file
run: |
echo "${{ secrets.DEVEL_ABN_DEPLOY }}" >> ssh_key
shell: bash
- name: Build and push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: ${{ format('./containers/{0}/', matrix.target-os ) }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
TARGET_OS=${{ matrix.target-os }}
COMPILER=${{ matrix.compiler }}
R_VERSION=${{ matrix.r-version }}
DESCRIPTION_FILE=${{ env.DESCRIPTION_FILE }}
REPO_PATH=${{ env.REPO_PATH }}
JAGS=${{ env.JAGS}}
secret-files: |
key=./ssh_key