-
Notifications
You must be signed in to change notification settings - Fork 196
43 lines (40 loc) · 1.16 KB
/
docker-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Build Tutorial Image
on:
workflow_call:
workflow_dispatch:
jobs:
build-images:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [rolling]
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
env:
GH_IMAGE: ghcr.io/${{ github.repository }}:${{ matrix.ROS_DISTRO }}
PUSH: ${{ (github.ref_name == 'main') }}
steps:
- name: Set lower case for container name
run: |
echo "GH_IMAGE_LC=${GH_IMAGE,,}" >>${GITHUB_ENV}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Tutorial Image
uses: docker/build-push-action@v6
with:
file: .docker/Dockerfile
build-args: |
ROS_DISTRO=${{ matrix.ROS_DISTRO }}
target: tutorial_image
push: ${{ env.PUSH }}
no-cache: false
tags: |
${{ env.GH_IMAGE_LC }}-tutorial