Skip to content

Commit

Permalink
update push job
Browse files Browse the repository at this point in the history
  • Loading branch information
pharmaverse-bot committed Oct 24, 2023
1 parent 6097514 commit 1236e00
Showing 1 changed file with 30 additions and 14 deletions.
44 changes: 30 additions & 14 deletions .github/workflows/push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
renv_list="${{ steps.changed-files.outputs.all_changed_files }}"
fi
renv_list=$(echo $renv_list | sed 's/ /", "/g')
renv_list="$renv_list devel" # adding devel conf
echo "renv=[\"$renv_list\"]" >> $GITHUB_OUTPUT
deploy-image:
Expand Down Expand Up @@ -77,20 +76,14 @@ jobs:
id: image_specs
run: |
package_name=$(grep "Package:" DESCRIPTION | awk '{print $NF}')
if [ "${{ matrix.value }}" == "devel" ]{
r_version="devel"
}
else {
r_version=$(basename $(dirname ${{ matrix.value }})) # TODO: check here if legacy renv (if yes, delete _legacy suffix and add _legacy suffix to docker im?)
renv=$(echo "${{ matrix.value }}" | tr -d '"')
echo "renv_lock_path=$renv" >> $GITHUB_OUTPUT
}
r_version=$(basename $(dirname ${{ matrix.value }})) # TODO: check here if legacy renv (if yes, delete _legacy suffix and add _legacy suffix to docker im?)
renv=$(echo "${{ matrix.value }}" | tr -d '"')
echo "renv_lock_path=$renv" >> $GITHUB_OUTPUT
echo "r_version=$r_version" >> $GITHUB_OUTPUT
echo "image_name=$package_name-$r_version" >> $GITHUB_OUTPUT
- name: Call deploy docker image action for every renv
uses: insightsengineering/r-image-creator@feature/create_image_from_description
if: ${{ matrix.value }} != 'devel'
with:
image-name: "${{ steps.image_specs.outputs.image_name }}"
tag-latest: true
Expand All @@ -100,19 +93,42 @@ jobs:
repository-owner: ${{ github.repository_owner }}
repo-user: ${{ github.actor }} # pharmaverse-bot
repo-token: "${{ secrets.GITHUB_TOKEN }}" # ${{ secrets.PHARMAVERSE_BOT }}

- name: Call deploy docker image action for every renv

deploy-image-devel:
runs-on: ubuntu-latest

# Token permissions
permissions:
contents: read
packages: write

steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set image specs
id: image_specs
run: |
package_name=$(grep "Package:" DESCRIPTION | awk '{print $NF}')
echo "image_name=$package_name-devel" >> $GITHUB_OUTPUT
- name: Call deploy docker image action devel
uses: insightsengineering/r-image-creator@feature/create_image_from_description
if: ${{ matrix.value }} == 'devel'
with:
image-name: "${{ steps.image_specs.outputs.image_name }}"
tag-latest: true
base-image: "rocker/rstudio:${{ steps.image_specs.outputs.r_version }}"
base-image: "rocker/rstudio:devel"
sysdeps: qpdf,libxt-dev,curl,npm,libicu-dev,libcurl4-openssl-dev,libssl-dev,make,zlib1g-dev,libfontconfig1-dev,libfreetype6-dev,libfribidi-dev,libharfbuzz-dev,libjpeg-dev,libpng-dev,libtiff-dev,pandoc,libxml2-dev,libgit2-dev,libgit2-dev,jq
description-file: "./DESCRIPTION"
repository-owner: ${{ github.repository_owner }}
repo-user: ${{ github.actor }} # pharmaverse-bot
repo-token: "${{ secrets.GITHUB_TOKEN }}" # ${{ secrets.PHARMAVERSE_BOT }}


# refacto todo: image-name, sysdeps on get-renv-list job


# note: in case of 403 error when pushing to ghcr : link current repo to the given package registry - https://github.com/docker/build-push-action/issues/687
# (got to https://github.com/<user name>?tab=packages to go to packages settings) and there https://github.com/users/<user name>/packages/container/admiralci-4.0/settings

0 comments on commit 1236e00

Please sign in to comment.