generated from LCAS/ros2_pkg_template
-
Notifications
You must be signed in to change notification settings - Fork 14
67 lines (63 loc) · 2.49 KB
/
dev-container.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
name: 'devcontainer CI'
on:
workflow_dispatch:
pull_request:
branches:
- deployment
push:
branches:
- deployment
tags:
- '*'
jobs:
build_devcontainer:
# only run for LCAS repositories
if: github.repository_owner == 'LCAS' || github.repository_owner == 'lcas'
runs-on: lcas
strategy:
matrix:
config:
- cuda-opengl
steps:
- name: Node Js
uses: actions/setup-node@v4
with:
node-version: "^16.13.0 || >=18.0.0"
- name: Checkout from github
uses: actions/checkout@v3
- name: extract the github reference
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: "image name from repo name"
id: docker_image_name
run: echo "docker_image=${{ github.repository }}" | tr '[:upper:]' '[:lower:]' |sed 's/[^0-9,a-z,A-Z,=,_,\/]/-/g' >>${GITHUB_OUTPUT}
- 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: Build dev container task
if: ${{ github.event_name == 'pull_request' }}
uses: devcontainers/[email protected]
with:
imageName: lcas.lincoln.ac.uk/devcontainer/${{ steps.docker_image_name.outputs.docker_image }}
configFile: ./.devcontainer/${{ matrix.config }}/devcontainer.json
push: never
imageTag: ${{ matrix.config }}-${{ env.BRANCH }}
#runCmd: "bash .devcontainer/run-ci.sh"
- name: Build and push dev container image
if: ${{ github.event_name != 'pull_request' }}
uses: devcontainers/[email protected]
with:
imageName: lcas.lincoln.ac.uk/devcontainer/${{ steps.docker_image_name.outputs.docker_image }}
configFile: ./.devcontainer/${{ matrix.config }}/devcontainer.json
push: always
imageTag: ${{ matrix.config }}-${{ env.BRANCH }}
#runCmd: "bash .devcontainer/run-ci.sh"