Skip to content

Update docker-image-perception-develop.yml #7

Update docker-image-perception-develop.yml

Update docker-image-perception-develop.yml #7

name: Docker Image CI - Feature Branch
on:
push:
branches: [feature/**]
jobs:
build-ros-perception-x86-64:
name: "Build ROS perception X86/64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:x86-perception-latest"
ARCH: x86
TARGET_TYPE: perception
TARGET_VERSION: feature
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Build the docker image (perception based)
run: |
docker build . --tag build-feature-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE}
- name: Create Docker Image Tag
run: |
docker tag build-feature-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-${TARGET_VERSION}-${GITHUB_REF##*/}
- name: Push Image to Github Packages Registry
run: |
docker push --all-tags ${GITHUB_REMOTE_URL}/${IMAGE_NAME}
build-ros-perception-arm64:
name: "Build ROS perception ARM64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:arm64-perception-latest"
ARCH: arm64
TARGET_TYPE: perception
TARGET_VERSION: feature
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Install QEMU to be able to compile on X86 into ARM64
run: |
sudo apt-get update
sudo apt-get install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build the docker image (perception based)
run: |
docker build . --tag build-feature-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE}
- name: Create Docker Image Tag
run: |
docker tag build-feature-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-${TARGET_VERSION}-${GITHUB_REF##*/}
- name: Push Image to Github Packages Registry
run: |
docker push --all-tags ${GITHUB_REMOTE_URL}/${IMAGE_NAME}
notify-success:
name: "Notify Slack - Success"
runs-on: ubuntu-latest
needs: [build-ros-perception-x86-64, build-ros-perception-arm64]
if: success()
steps:
- name: Notify Slack Success
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: github-ci-notifications
status: SUCCESS
color: good
notify-fail:
name: "Notify Slack - Failure"
runs-on: ubuntu-latest
needs: [build-ros-perception-x86-64, build-ros-perception-arm64]
if: failure()
steps:
- name: Notify Slack Fail
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: github-ci-notifications
status: FAILED
color: danger