Skip to content

Moving dockerfiles, removing use of dep image #3

Moving dockerfiles, removing use of dep image

Moving dockerfiles, removing use of dep image #3

name: build
# on:
# pull_request:
# branches: [ main ]
# schedule:
# - cron: '1 8 * * *'
on: push
env:
REGISTRY: ghcr.io
jobs:
build-image:
name: Build and push image
runs-on: ubuntu-latest
strategy:
matrix:
ros2-distro: [humble]
steps:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract tags for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ github.repository }}/rmf-demos-${{ matrix.ros2-distro }}
tags: type=raw,value={{date 'YYYYMMDD'}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
file: ./docker/${{ matrix.ros2-distro }}.Dockerfile
push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
tags: |
${{ steps.meta.outputs.tags }}
${{ github.repository }}/rmf-demos-${{ matrix.ros2-distro }}:latest
build-release-image:
name: Build and push release image
runs-on: ubuntu-latest
strategy:
matrix:
ros2-distro: [humble]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.ros2-distro }}-release
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract tags for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ github.repository }}/rmf-demos-${{ matrix.ros2-distro }}-release
tags: type=raw,value={{date 'YYYYMMDD'}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
file: ./docker/${{ matrix.ros2-distro }}-release.Dockerfile
push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
tags: |
${{ steps.meta.outputs.tags }}
${{ github.repository }}/rmf-demos-${{ matrix.ros2-distro }}-release:latest