-
Notifications
You must be signed in to change notification settings - Fork 26
70 lines (62 loc) · 1.89 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
name: Docker Images
on:
push:
paths:
- ".docker/*"
- ".github/workflows/docker.yml"
branches: ["**"]
tags-ignore: ["**"]
pull_request:
paths:
- ".docker/*"
- ".github/workflows/docker.yml"
workflow_dispatch:
schedule:
# Execute a weekly build on Monday at 2AM UTC
- cron: '0 2 * * 1'
jobs:
docker:
name: 'diegoferigo/gym-ignition:${{ matrix.tag }}'
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
baseimage: ['ubuntu:bionic']
tag:
- base
- ci-master
- ci-devel
- pypi-master
- pypi-devel
#- latest
- nightly
steps:
# Use the branch that triggered the workflow for push and pull_request events
- uses: actions/checkout@master
if: github.event_name != 'schedule'
# Use devel branch for scheduled builds
- uses: actions/checkout@master
with:
ref: 'refs/heads/devel'
if: github.event_name == 'schedule'
- name: Build
env:
TAG: ${{ matrix.tag }}
run: |
cd .docker
docker-compose build ${TAG}
- name: Login
if: |
github.repository == 'robotology/gym-ignition' &&
github.event_name != 'pull_request' &&
(github.event_name == 'schedule' || github.ref == 'refs/heads/devel')
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
run: echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_USERNAME} --password-stdin
- name: Push
if: |
github.repository == 'robotology/gym-ignition' &&
github.event_name != 'pull_request' &&
(github.event_name == 'schedule' || github.ref == 'refs/heads/devel')
run: docker push diegoferigo/gym-ignition:${{ matrix.tag }}