Update Mavlink git repo, remove hot-patching of mavros and mavlink code (backport #358) #609
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: Docker | |
on: | |
schedule: | |
- cron: "0 17 * * 6" | |
push: | |
branches: | |
- jazzy | |
pull_request: | |
paths: | |
- .docker/** | |
- .github/workflows/docker.yaml | |
- blue.repos | |
- requirements-build.txt | |
workflow_dispatch: | |
env: | |
PUSH: ${{ (github.event_name != 'pull_request') && (github.repository == 'Robotic-Decision-Making-Lab/blue') }} | |
jobs: | |
docker_build: | |
strategy: | |
fail-fast: false | |
matrix: | |
ROS_DISTRO: [jazzy] | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- # Add support for more platforms with QEMU (optional) | |
# https://github.com/docker/setup-qemu-action | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
# Pin docker-buildx to this version for now | |
# v0.19.2 has issues with empty keys, | |
# particularly the "*.cache-to=" used below | |
# | |
version: v0.18.0 | |
- if: env.PUSH == 'true' | |
name: Log into registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# buildx bake, unfortunately, requires lower-cased repository names | |
# This shell ... er, hack, creates a local variable containing | |
# a down-cased version of $GITHUB_REPOSITORY | |
# | |
- id: lowercase-repo | |
name: Repository to lowercase | |
run: | | |
echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT | |
# Set metadata for each stage-image separately | |
- name: Set Docker metadata for "ci" | |
if: env.PUSH == 'true' | |
id: meta-ci | |
uses: docker/[email protected] | |
with: | |
images: ghcr.io/${{ github.repository }} | |
bake-target: docker-metadata-action-ci | |
tags: | | |
type=raw,value=${{ matrix.ROS_DISTRO }}-ci | |
- name: Set Docker metadata for "robot" | |
if: env.PUSH == 'true' | |
id: meta-robot | |
uses: docker/[email protected] | |
with: | |
images: ghcr.io/${{ github.repository }} | |
bake-target: docker-metadata-action-robot | |
tags: | | |
type=raw,value=${{ matrix.ROS_DISTRO }}-robot | |
- name: Set Docker metadata for "desktop" | |
if: env.PUSH == 'true' | |
id: meta-desktop | |
uses: docker/[email protected] | |
with: | |
images: ghcr.io/${{ github.repository }} | |
bake-target: docker-metadata-action-desktop | |
tags: | | |
type=raw,value=${{ matrix.ROS_DISTRO }}-desktop | |
- name: Set Docker metadata for "desktop-nvidia" | |
if: env.PUSH == 'true' | |
id: meta-desktop-nvidia | |
uses: docker/[email protected] | |
with: | |
images: ghcr.io/${{ github.repository }} | |
bake-target: docker-metadata-action-desktop-nvidia | |
tags: | | |
type=raw,value=${{ matrix.ROS_DISTRO }}-desktop-nvidia | |
- if: github.event_name == 'push' | |
name: Build and push (non PR) | |
uses: docker/[email protected] | |
env: | |
BLUE_ROS_DISTRO: ${{ matrix.ROS_DISTRO }} | |
BLUE_GITHUB_REPO: ${{ steps.lowercase-repo.outputs.repository }} | |
with: | |
workdir: .docker | |
files: | | |
./docker-bake.hcl | |
${{ steps.meta-ci.outputs.bake-file }} | |
${{ steps.meta-robot.outputs.bake-file }} | |
${{ steps.meta-desktop.outputs.bake-file }} | |
${{ steps.meta-desktop-nvidia.outputs.bake-file }} | |
push: ${{ env.PUSH }} | |
set: | | |
*.cache-from=type=registry,ref=ghcr.io/${{ steps.lowercase-repo.outputs.repository }}:cache-${{ matrix.ROS_DISTRO }} | |
*.cache-to=type=registry,mode=max,ref=ghcr.io/${{ steps.lowercase-repo.outputs.repository }}:cache-${{ matrix.ROS_DISTRO }} | |
# Pull request builds are not cached; and only built for AMD64 | |
- if: github.event_name == 'pull_request' | |
name: Build and push (PR) | |
uses: docker/[email protected] | |
env: | |
BLUE_ROS_DISTRO: ${{ matrix.ROS_DISTRO }} | |
BLUE_GITHUB_REPO: ${{ steps.lowercase-repo.outputs.repository }} | |
with: | |
workdir: .docker | |
files: | | |
./docker-bake.hcl | |
set: | | |
*.platform=linux/amd64 | |
*.cache-from=type=registry,ref=ghcr.io/${{ steps.lowercase-repo.outputs.repository }}:cache-${{ matrix.ROS_DISTRO }} | |
*.cache-to= |