-
Notifications
You must be signed in to change notification settings - Fork 42
76 lines (73 loc) · 1.95 KB
/
docker.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
name: Dockerfiles
# Test and push dockerfiles when they change.
# Test for pull request, push dockerfiles when merged into main.
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: 0 0 1 * *
push:
branches:
- main
paths:
- '**.Dockerfile'
- .github/workflows/docker.yml
pull_request:
workflow_dispatch:
# Cancel in-progress funs of the same workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
cache: pip
- name: Verify dockerfiles
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
./generate.py
git diff --exit-code
docker:
needs: generate
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
docker_image:
- noetic
- melodic
- humble
- humble-cuda
- foxy
- foxy-cuda
- gazebo11
- fortress
- citadel
- garden
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
cache: pip
- name: Build Setup
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build
run: |
./build.py ${{ matrix.docker_image }}
- name: Push
if: github.ref == 'refs/heads/main'
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
run: |
./build.py --push ${{ matrix.docker_image }}