use macos for github actions #19
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: Build | |
on: [push] | |
jobs: | |
# build: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Install ROS Tooling | |
# uses: ros-tooling/[email protected] | |
# with: | |
# required-ros-distributions: iron | |
# - name: Checkout code | |
# uses: actions/checkout@v2 | |
# - name: Install Pangolin | |
# run: | | |
# mkdir thirdparty && cd thirdparty | |
# git clone --recursive https://github.com/stevenlovegrove/Pangolin.git --depth 1 | |
# cd Pangolin | |
# yes | ./scripts/install_prerequisites.sh required | |
# cmake -B build | |
# cmake --build build -j 4 | |
# sudo cmake --install build | |
# - name: Install cv_bridge | |
# run: sudo apt install -y ros-iron-cv-bridge | |
# - name: Install interactive_markers | |
# run: sudo apt install -y ros-iron-interactive-markers | |
# - name: Build Project | |
# uses: ros-tooling/[email protected] | |
# with: | |
# target-ros2-distro: iron | |
# skip-tests: true | |
build-docker: | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_IMAGE: joshuabird/part_ii_project | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
PROGRESS_NO_TRUNC: 1 | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v1 | |
- name: Set up Docker Buildx | |
uses: crazy-max/ghaction-docker-buildx@v1 | |
with: | |
version: latest | |
- name: Prepare | |
if: success() | |
id: prepare | |
run: | | |
echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM} | |
echo ::set-output name=docker_image::${DOCKER_IMAGE} | |
- name: Docker Login | |
if: success() | |
run: | | |
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin | |
- name: Run Buildx (push image) | |
if: success() | |
run: | | |
docker buildx build \ | |
--tag ${{ steps.prepare.outputs.docker_image }}:latest \ | |
--file ./Dockerfile \ | |
--progress plain \ | |
--cache-to=type=inline,mode=max \ | |
--cache-from type=registry,ref=${{ steps.prepare.outputs.docker_image }}:latest \ | |
--output type=image,push=true . | |
build-nvidia-jetson-docker: | |
runs-on: macos-latest | |
env: | |
DOCKER_IMAGE: joshuabird/part_ii_project_nvidia_jetson | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKER_TARGET_PLATFORM: linux/arm64 | |
PROGRESS_NO_TRUNC: 1 | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v1 | |
- name: Set up Docker Buildx | |
uses: crazy-max/ghaction-docker-buildx@v1 | |
with: | |
version: latest | |
- name: Prepare | |
if: success() | |
id: prepare | |
run: | | |
echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM} | |
echo ::set-output name=docker_image::${DOCKER_IMAGE} | |
- name: Docker Login | |
if: success() | |
run: | | |
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin | |
- name: Run Buildx (push image) | |
if: success() | |
run: | | |
docker buildx build \ | |
--platform ${{ steps.prepare.outputs.docker_platform }} \ | |
--tag ${{ steps.prepare.outputs.docker_image }}:latest \ | |
--file ./nvidia_jetson.Dockerfile \ | |
--progress plain \ | |
--cache-to=type=inline,mode=max \ | |
--cache-from type=registry,ref=${{ steps.prepare.outputs.docker_image }}:latest \ | |
--output type=image,push=true . |