-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (56 loc) · 1.83 KB
/
docker-build.yaml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build Docker Images
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
schedule:
- cron: '30 4 * * 0,2,4,6'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
tag:
# - noetic
- humble
- iron
- rolling
steps:
- uses: actions/checkout@v3
- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Docker Login LCAS
if: ${{ github.event_name != 'pull_request' }}
# You may pin to the exact commit or the version.
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v3
with:
# Server address of Docker registry. If not set then will default to Docker Hub
registry: lcas.lincoln.ac.uk
# Username used to log against the Docker registry
username: ${{ secrets.LCAS_REGISTRY_PUSHER }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}
- name: Docker Login dockerhub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
# Username used to log against the Docker registry
username: ${{ secrets.DOCKERHUB_USER }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: lcas.lincoln.ac.uk/lcas/ros:${{ matrix.tag }}
build-args: |
BASE_IMAGE=ros:${{ matrix.tag }}
BRANCH=${{ env.BRANCH }}