Docker CI/CD #49
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 CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
merge_group: | |
branches: [ "master" ] | |
workflow_dispatch: | |
inputs: | |
copter: | |
description: 'Copter Version (#.#.#)' | |
required: true | |
type: string | |
plane: | |
description: 'Plane Version (#.#.#)' | |
required: true | |
type: string | |
env: | |
COPTER_VERSION: '4.3.7' | |
PLANE_VERSION: '4.3.4' | |
jobs: | |
Copter-x86: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Copy Shared Libraries | |
run: bash ${GITHUB_WORKSPACE}/configure.sh | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Build and Push | |
uses: docker/build-push-action@v4 | |
with: | |
context: x86/ | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ubcuas/uasitl:copter-${{ inputs.copter || env.COPTER_VERSION }} | |
build-args: VERSION=${{ inputs.copter || env.COPTER_VERSION }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
Copter-arm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Copy Shared Libraries | |
run: bash ${GITHUB_WORKSPACE}/configure.sh | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Build and Push | |
uses: docker/build-push-action@v4 | |
with: | |
context: arm/ | |
platforms: linux/arm/v7,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ubcuas/uasitl:copter-arm-${{ inputs.copter || env.COPTER_VERSION }} | |
build-args: VERSION=${{ inputs.copter || env.COPTER_VERSION }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
Plane-x86: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Copy Shared Libraries | |
run: bash ${GITHUB_WORKSPACE}/configure.sh | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Build and Push | |
uses: docker/build-push-action@v4 | |
with: | |
context: x86/ | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ubcuas/uasitl:plane-${{ inputs.plane || env.PLANE_VERSION }} | |
build-args: | | |
VEHICLE_TYPE=1 | |
VERSION=${{ inputs.plane || env.PLANE_VERSION }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
Plane-arm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Copy Shared Libraries | |
run: bash ${GITHUB_WORKSPACE}/configure.sh | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Build and Push | |
uses: docker/build-push-action@v4 | |
with: | |
context: arm/ | |
platforms: linux/arm/v7,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ubcuas/uasitl:plane-arm-${{ inputs.plane || env.PLANE_VERSION }} | |
build-args: | | |
VEHICLE_TYPE=1 | |
VERSION=${{ inputs.plane || env.PLANE_VERSION }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |