forked from westonrobot/limo_ros2_docker
-
Notifications
You must be signed in to change notification settings - Fork 9
125 lines (116 loc) · 4.5 KB
/
docker-build.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Docker Image CI
on:
push:
paths:
- .devcontainer/**
branches: [ humble ]
tags:
- '*'
pull_request:
branches: [ humble ]
paths:
- .devcontainer/**
jobs:
# trigger:
# runs-on: ubuntu-latest
# # only do this if we don't have a pull request
# if: ${{ github.event_name != 'pull_request' }}
# steps:
# - uses: lasith-kg/dispatch-workflow@v1
# id: workflow-dispatch_develop
# name: 'Trigger re-build of desktop docker image "develop"'
# with:
# dispatch-method: workflow_dispatch
# repo: kasm-workspaces-core-images
# owner: LCAS
# ref: refs/heads/develop # or main
# workflow: docker-latest.yml # Or Workflow ID
# token: ${{ secrets.ORGA_GH_TOKEN }} # GitHub Token With Relevant Permissions
# - uses: lasith-kg/dispatch-workflow@v1
# id: workflow-dispatch_nvidia_develop
# name: 'Trigger re-build of desktop docker image "nvidia_develop"'
# with:
# dispatch-method: workflow_dispatch
# repo: kasm-workspaces-core-images
# owner: LCAS
# ref: refs/heads/nvidia_develop # or main
# workflow: docker-latest.yml # Or Workflow ID
# token: ${{ secrets.ORGA_GH_TOKEN }} # GitHub Token With Relevant Permissions
build_amd64:
runs-on: lcas
steps:
- uses: actions/checkout@v3
- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Docker Login LCAS
# don't attempt to login for PRs
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@v2
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
# don't attempt to login for PRs
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
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 and push limo_ros2 for amd64
uses: docker/build-push-action@v5
with:
context: .
file: .devcontainer/Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: lcas.lincoln.ac.uk/lcas/limo_ros_amd64:${{ env.BRANCH }}
build-args: |
BRANCH=${{ env.BRANCH }}
build_arm64:
runs-on: lcas
steps:
- uses: actions/checkout@v3
- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Docker Login LCAS
# don't attempt to login for PRs
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@v2
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
# don't attempt to login for PRs
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
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: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build and push limo_ros2 for arm64
uses: docker/build-push-action@v5
with:
context: .
file: .devcontainer/Dockerfile
platforms: linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: lcas.lincoln.ac.uk/lcas/limo_ros_arm64:${{ env.BRANCH }}
build-args: |
BRANCH=${{ env.BRANCH }}