From c6bd63f21276d7aa08b3269fefea9a721babf94d Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Mon, 6 Jan 2025 16:40:48 +0800 Subject: [PATCH] Base image docker image and nightly CI to push, temporarily running on push Signed-off-by: Aaron Chong --- .github/docker/nexus-base/Dockerfile | 22 ++++++++++++++++ .github/workflows/nightly.yaml | 38 ++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/docker/nexus-base/Dockerfile create mode 100644 .github/workflows/nightly.yaml diff --git a/.github/docker/nexus-base/Dockerfile b/.github/docker/nexus-base/Dockerfile new file mode 100644 index 0000000..2bfe70a --- /dev/null +++ b/.github/docker/nexus-base/Dockerfile @@ -0,0 +1,22 @@ +ARG ROS_DISTRO=jazzy +FROM docker.io/ros:$ROS_DISTRO-ros-base +ARG NEXUS_BRANCH=main + +RUN apt update && apt install -y git curl libclang-dev clang clang-tools lld + +RUN mkdir -p /ws_nexus_base/src && cd /ws_nexus_base \ + && curl --output abb.repos https://raw.githubusercontent.com/osrf/nexus/refs/heads/$NEXUS_BRANCH/abb.repos \ + && vcs import /ws_nexus_base/src < abb.repos \ + && curl --output rmf.repos https://raw.githubusercontent.com/osrf/nexus/refs/heads/$NEXUS_BRANCH/rmf.repos \ + && vcs import /ws_nexus_base/src < rmf.repos + +RUN rosdep update && rosdep install --from-paths /ws_nexus_base/src -yi + +RUN cd /ws_nexus_base \ + && . /opt/ros/$ROS_DISTRO/setup.sh \ + && colcon build --merge-install --install-base /opt/nexus_base --cmake-args -DCMAKE_BUILD_TYPE=Release \ + && rm -rf /ws_nexus_base + +RUN rm -rf \ + /var/lib/apt/lists \ + /dist diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml new file mode 100644 index 0000000..30077e6 --- /dev/null +++ b/.github/workflows/nightly.yaml @@ -0,0 +1,38 @@ +name: nightly + +# on: +# schedule: +# # 2am SGT +# - cron: '0 18 * * *' + +on: [push] + +jobs: + build-nexus-base-image: + name: Push nexus base docker image to GitHub Packages + runs-on: ubuntu-latest + strategy: + matrix: + ros_distribution: [jazzy] + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to docker + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push nexus-base + uses: docker/build-push-action@v5 + with: + push: true + build-args: | + ROS_DISTRO=${{ matrix.ros_distribution }} + NEXUS_BRANCH=base-docker-images + tags: ghcr.io/${{ github.repository }}/nexus-base:${{ matrix.ros_distribution }}-latest + context: .github/docker/nexus-base