Skip to content

Docker

Docker #69

Workflow file for this run

name: Docker
on:
schedule:
# 6 AM UTC every Sunday
- cron: "0 6 * * 6"
workflow_dispatch:
push:
branches:
- noetic-devel
- master
concurrency: # cancel any previous workflow(s) from the same PR or branch/tag
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# release:
# strategy:
# fail-fast: false
# matrix:
# ROS_DISTRO: [noetic]
# runs-on: ubuntu-latest
# permissions:
# packages: write
# contents: read
# env:
# IMAGE: mujoco_ros/mujoco_ros:${{ matrix.ROS_DISTRO }}-${{ github.job }}
# steps:
# - name: Check for apt updates
# uses: rhaschke/docker-run-action@v4
# continue-on-error: true
# id: apt
# with:
# image: ${{ env.IMAGE }}
# run: |
# apt-get update
# have_updates=$(apt-get --simulate upgrade | grep -q "^0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.$" && echo false || echo true)
# echo "no_cache=$have_updates" >> "$GITHUB_OUTPUT"
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# if: ${{ github.event_name == 'workflow_dispatch' || github.event_name != 'schedule' || steps.apt.outputs.no_cache }}
# - name: Login to GitLab Container Registry
# uses: docker/login-action@v3
# with:
# registry: gitlab.ub.uni-bielefeld.de:4567
# username: ${{ secrets.GITLAB_REG_USER }}
# password: ${{ secrets.GITLAB_REG_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v5
# if: ${{ github.event_name == 'workflow_dispatch' || github.event_name != 'schedule' || steps.apt.outputs.no_cache }}
# with:
# file: .docker/${{ github.job }}/Dockerfile
# build-args: ROS_DISTRO=${{ matrix.ROS_DISTRO }}
# push: true
# cache-to: type=inline
# tags: gitlab.ub.uni-bielefeld.de:4567/${{ env.IMAGE }}
ci:
strategy:
fail-fast: false
matrix:
IMAGE: [noetic]
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
env:
REGISTRY: docker.io
IMAGE: docker.io/davidpl1/mujoco_ros:${{ matrix.IMAGE }}-${{ github.job }}
ROS_DISTRO: noetic
MUJOCO_VERSIONS: '[2.3.6,2.3.7]'
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name != 'schedule' }}
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Check for apt updates
uses: rhaschke/docker-run-action@v4
continue-on-error: true
id: apt
with:
image: ${{ env.IMAGE }}
shell: bash
run: |
apt-get update
have_updates=$(apt-get --simulate upgrade | grep -q "^0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.$" && echo false || echo true)
echo "no_cache=$have_updates" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v5
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name != 'schedule' || steps.apt.outputs.no_cache }}
with:
file: .docker/${{ github.job }}/Dockerfile
build-args: |
ROS_DISTRO=${{ env.ROS_DISTRO }}
MUJOCO_VERSIONS=${{ env.MUJOCO_VERSIONS }}
no-cache: true
# no-cache: ${{ steps.apt.outputs.no_cache || github.event_name == 'workflow_dispatch' }}
# no-cache: ${{ steps.apt.outputs.no_cache }} # TODO: remove this line, currently only to save time
cache-from: type=registry,ref=${{ env.IMAGE }}
cache-to: type=inline
push: true
tags: |
${{ env.IMAGE }}
${{ env.REGISTRY }}/davidpl1/mujoco_ros:master-ci-testing
ci-testing:
needs: ci
strategy:
fail-fast: false
matrix:
IMAGE: [noetic]
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
env:
IMAGE: docker.io/davidpl1/mujoco_ros:${{ matrix.IMAGE }}-${{ github.job }}
REGISTRY: docker.io
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name != 'schedule' }}
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Check for apt updates
uses: rhaschke/docker-run-action@v4
continue-on-error: true
id: apt
with:
image: ${{ env.IMAGE }}
run: |
apt-get update
have_updates=$(apt-get --simulate upgrade | grep -q "^0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.$" && echo false || echo true)
echo "no_cache=$have_updates" >> "$GITHUB_OUTPUT"
- name: Build and Push
uses: docker/build-push-action@v5
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name != 'schedule' || steps.apt.outputs.no_cache }}
with:
file: .docker/${{ github.job }}/Dockerfile
build-args: IMAGE=${{ matrix.IMAGE }}
no-cache: ${{ steps.apt.outputs.no_cache || github.event_name == 'workflow_dispatch' }}
cache-from: type=registry,ref=${{ env.IMAGE }}
cache-to: type=inline
push: true
tags: |
${{ env.IMAGE }}
${{ env.REGISTRY }}/davidpl1/mujoco_ros:${{ matrix.IMAGE }}-ci-shadow-fixed
source:
needs: ci-testing
strategy:
fail-fast: false
matrix:
IMAGE: [noetic]
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
env:
REGISTRY: docker.io
IMAGE: docker.io/davidpl1/mujoco_ros:${{ matrix.IMAGE }}-${{ github.job }}
ROS_DISTRO: noetic
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Remove .dockerignore"
run: rm .dockerignore # enforce full source context
continue-on-error: true
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: .docker/${{ github.job }}/Dockerfile
build-args: IMAGE=${{ matrix.IMAGE }}
cache-from: type=registry,ref=${{ env.IMAGE }}
cache-to: type=inline
push: true
tags: |
${{ env.IMAGE }}
${{ env.REGISTRY }}/davidpl1/mujoco_ros:master-ci-testing