-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (69 loc) · 2.12 KB
/
cd.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This is a basic workflow to help you get started with Actions
name: Binary Deployment
# Controls when the action will run.
on:
push:
tags:
- '[v]?[0-9]+.[0-9]+.[0-9]+'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
cancel:
name: Cancel Previous Runs
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: cancel
if: github.event_name != 'pull_request'
strategy:
matrix:
job:
- name: focal
distro: focal
base_image: nvidia/opengl:1.2-glvnd-runtime-ubuntu20.04
- name: focal-nogpu
distro: focal
base_image: ubuntu:focal
# - name: bionic
# distro: bionic
# base_image: nvidia/opengl:1.2-glvnd-runtime-ubuntu18.04
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Setup SSH Keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v5
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
with:
file: Dockerfile.binary
push: true
tags: lmark1/uav_ros_simulation:${{ matrix.job.name }}-bin-${{ github.ref_name }}
ssh: |
default=/tmp/ssh_agent.sock
build-args: |
DISTRO=${{ matrix.job.distro }}
VERSION=${{ github.ref_name }}
BASE_IMAGE=${{ matrix.job.base_image }}