-
Notifications
You must be signed in to change notification settings - Fork 6
43 lines (41 loc) · 1.3 KB
/
docker.yml
File metadata and controls
43 lines (41 loc) · 1.3 KB
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: Docker
on:
push:
branches: [master, renovate/**]
tags:
- v*
pull_request:
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
cmd: [ssl-vision-client, ssl-vision-cli]
steps:
- uses: actions/checkout@v6
- uses: docker/setup-qemu-action@v4
- uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Determine tag
id: tag
run: |
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
echo "tag=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
else
echo "tag=latest" >> "$GITHUB_OUTPUT"
fi
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
file: ./cmd/${{ matrix.cmd }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}
tags: robocupssl/${{ matrix.cmd }}:${{ steps.tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max