Skip to content

Fix Dockerfile to correctly copy repository files with wildcard pattern #3

Fix Dockerfile to correctly copy repository files with wildcard pattern

Fix Dockerfile to correctly copy repository files with wildcard pattern #3

Workflow file for this run

name: Build Docker image
on:
workflow_dispatch:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main ]
jobs:
build-docker-image:
if: github.repository_owner == 'LCAS'
runs-on: lcas
strategy:
fail-fast: false
matrix:
include:
- base_image: lcas.lincoln.ac.uk/lcas/ros:jammy-humble-cuda12.2-opengl-1
ros_distro: humble
push_image: lcas.lincoln.ac.uk/lcas/limo_platform_amd64
steps:
- name: Node Js
uses: actions/setup-node@v4
with:
node-version: "^16.13.0 || >=18.0.0"
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Docker Login LCAS
uses: docker/login-action@v3
with:
registry: lcas.lincoln.ac.uk
username: ${{ secrets.LCAS_REGISTRY_PUSHER }}
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}
- name: Docker meta
id: meta_public
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ matrix.push_image }}
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=staging
type=raw,enable=${{ github.event_name != 'pull_request' }},value=latest
type=ref,enable=${{ github.event_name != 'pull_request' }},event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build Public Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
pull: true
push: true
tags: ${{ steps.meta_public.outputs.tags }}
labels: ${{ steps.meta_public.outputs.labels }}
build-args: |
BASE_IMAGE=${{ matrix.base_image }}
BRANCH=${{ env.BRANCH }}
ROS_DISTRO=${{ matrix.ros_distro }}
build-arm-docker-image:
if: github.repository_owner == 'LCAS'
runs-on:
- lcas-runc
- runc
strategy:
fail-fast: false
matrix:
include:
- base_image: lcas.lincoln.ac.uk/lcas/ros:jammy-humble-cuda12.2-opengl-arm64-1
ros_distro: humble
push_image: lcas.lincoln.ac.uk/lcas/limo_platform_arm64
steps:
- name: Node Js
uses: actions/setup-node@v4
with:
node-version: "^16.13.0 || >=18.0.0"
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Docker Login LCAS
uses: docker/login-action@v3
with:
registry: lcas.lincoln.ac.uk
username: ${{ secrets.LCAS_REGISTRY_PUSHER }}
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}
- name: Docker meta
id: meta_public
uses: docker/metadata-action@v5
with:
flavor: |
latest=false
# list of Docker images to use as base name for tags
images: |
${{ matrix.push_image }}
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=staging
type=raw,enable=${{ github.event_name != 'pull_request' }},value=latest
type=ref,enable=${{ github.event_name != 'pull_request' }},event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build Public Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/arm64
pull: true
push: true
tags: ${{ steps.meta_public.outputs.tags }}
labels: ${{ steps.meta_public.outputs.labels }}
build-args: |
BASE_IMAGE=${{ matrix.base_image }}
BRANCH=${{ env.BRANCH }}
ROS_DISTRO=${{ matrix.ros_distro }}