Build & Push R devel images #1424
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Push R devel images | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
check-revision: | |
runs-on: ubuntu-latest | |
outputs: | |
svn-revision: ${{ steps.check-revision.outputs.REV }} | |
steps: | |
- uses: actions/checkout@v4.1.4 | |
- name: Check R devel revision | |
id: check-revision | |
run: | | |
pushd "${{ runner.temp }}" | |
wget https://cloud.r-project.org/src/base-prerelease/R-devel.tar.gz -O R.tar.gz | |
tar xzf R.tar.gz | |
REV="$(grep 'Revision:' < R-devel/SVN-REVISION | sed -e 's/Revision:\s*//g')" | |
echo "REV=${REV}" >>"$GITHUB_OUTPUT" | |
build: | |
runs-on: ubuntu-latest | |
needs: | |
- check-revision | |
strategy: | |
fail-fast: false | |
matrix: | |
bakefile: | |
- devel.docker-bake.json | |
steps: | |
- uses: actions/checkout@v4.1.4 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Expose GitHub Runtime | |
uses: crazy-max/ghaction-github-runtime@v3 | |
- name: Build and push Docker images | |
run: | | |
CACHE_DIR="${{ runner.temp }}" | |
# Build rocker/r-ver | |
BAKE_JSON="bakefiles/${{ matrix.bakefile }}" \ | |
BAKE_OPTION=--push\ --set=*.cache-to=type=local,dest="${CACHE_DIR}"\ --set=*.cache-from=type=local,src="${CACHE_DIR}"\ | |
\ --set=*.cache-from=type=gha,scope=svn-revision-"${{ needs.check-revision.outputs.svn-revision }}-r-ver"\ | |
\ --set=*.cache-from=type=gha,scope=svn-revision-"${{ needs.check-revision.outputs.svn-revision }}-rstudio"\ | |
\ --set=*.cache-from=type=gha,scope=svn-revision-"${{ needs.check-revision.outputs.svn-revision }}-tidyverse"\ | |
\ --set=*.cache-to=type=gha,scope=svn-revision-"${{ needs.check-revision.outputs.svn-revision }}-r-ver" \ | |
make bake-json/r-ver | |
# Build rocker/rstudio | |
BAKE_JSON="bakefiles/${{ matrix.bakefile }}" \ | |
BAKE_OPTION=--push\ --set=*.cache-to=type=local,dest="${CACHE_DIR}"\ --set=*.cache-from=type=local,src="${CACHE_DIR}"\ | |
\ --set=*.cache-from=type=gha,scope=svn-revision-"${{ needs.check-revision.outputs.svn-revision }}-r-ver"\ | |
\ --set=*.cache-from=type=gha,scope=svn-revision-"${{ needs.check-revision.outputs.svn-revision }}-rstudio"\ | |
\ --set=*.cache-from=type=gha,scope=svn-revision-"${{ needs.check-revision.outputs.svn-revision }}-tidyverse"\ | |
\ --set=*.cache-to=type=gha,scope=svn-revision-"${{ needs.check-revision.outputs.svn-revision }}-rstudio" \ | |
make bake-json/rstudio | |
# Build rocker/tidyverse | |
BAKE_JSON="bakefiles/${{ matrix.bakefile }}" \ | |
BAKE_OPTION=--push\ --set=*.cache-to=type=local,dest="${CACHE_DIR}"\ --set=*.cache-from=type=local,src="${CACHE_DIR}"\ | |
\ --set=*.cache-from=type=gha,scope=svn-revision-"${{ needs.check-revision.outputs.svn-revision }}-r-ver"\ | |
\ --set=*.cache-from=type=gha,scope=svn-revision-"${{ needs.check-revision.outputs.svn-revision }}-rstudio"\ | |
\ --set=*.cache-from=type=gha,scope=svn-revision-"${{ needs.check-revision.outputs.svn-revision }}-tidyverse"\ | |
\ --set=*.cache-to=type=gha,scope=svn-revision-"${{ needs.check-revision.outputs.svn-revision }}-tidyverse" \ | |
make bake-json/tidyverse |