forked from devrt/robocup2021-opl
-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (38 loc) · 1.23 KB
/
docker-publish.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
name: Docker
on:
push:
# Publish `main` as Docker `latest` image.
branches:
- main
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for any PRs.
pull_request:
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
docker:
runs-on: ubuntu-18.04
if: github.event_name == 'push'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build image and push
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker build -f Dockerfile.tiago -t $IMAGE_ID:tiago .
docker push $IMAGE_ID:tiago
- name: Build nvidia image and push
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker build --build-arg BASE_IMAGE=$IMAGE_ID:tiago -f Dockerfile.nvidia -t $IMAGE_ID:tiago-nvidia .
docker push $IMAGE_ID:tiago-nvidia