diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml index d957dd05..75c89519 100644 --- a/.github/workflows/push-docker-image.yml +++ b/.github/workflows/push-docker-image.yml @@ -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: @@ -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 @@ -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/?tab=packages to go to packages settings) and there https://github.com/users//packages/container/admiralci-4.0/settings \ No newline at end of file