Skip to content

Workflow file for this run

name: Build R and push to Docker Hub
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'r/Dockerfile'
- 'script/docker_build.sh'
- '.github/workflows/build_r.yml'
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
-
name: Build and push
run: |
img=davetang/r_build
df=r/Dockerfile
script/docker_build.sh ${df} ${img}
ver=$(cat ${df} | grep "^FROM" | cut -f2 -d':')
docker push ${img}:${ver}