-
Notifications
You must be signed in to change notification settings - Fork 61
31 lines (30 loc) · 982 Bytes
/
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
name: CarlaViz Docker Depolyment
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+' # semantic version
- '[0-9]+.[0-9]+.[0-9]+.[0-9]+.'
branches:
- master
jobs:
release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker image on Tag
if: github.ref != 'refs/heads/master'
run: docker build -t mjxu96/carlaviz:${{ github.ref_name }} .
- name: Push image on Tag
if: github.ref != 'refs/heads/master'
run: docker push mjxu96/carlaviz:${{ github.ref_name }}
- name: Build Docker image on Master
if: github.ref == 'refs/heads/master'
run: docker build -t mjxu96/carlaviz:latest .
- name: Push image on Master
if: github.ref == 'refs/heads/master'
run: docker push mjxu96/carlaviz:latest