Skip to content

Commit ce43bce

Browse files
authored
Add docker image CI
1 parent a50a131 commit ce43bce

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docker Image CI
2+
3+
# Controls when the workflow will run
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the master branch
6+
push:
7+
branches: [ master ]
8+
tags: [ "v*.*.*" ]
9+
pull_request:
10+
branches: [ master ]
11+
release:
12+
types: ["created"]
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
inputs: {}
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallelname: ci
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-22.04
22+
steps:
23+
- uses: actions/checkout@v3
24+
with:
25+
# Need tags for Makefile logic to work
26+
fetch-depth: 0
27+
- name: Build the Docker images
28+
run: make image
29+
deploy:
30+
needs: [ "build" ]
31+
runs-on: ubuntu-22.04
32+
if: github.event_name == 'release' && github.event.action == 'created'
33+
steps:
34+
- name: Login to Docker Hub
35+
uses: docker/login-action@v2
36+
with:
37+
username: ${{ secrets.DOCKERHUB_USERNAME }}
38+
password: ${{ secrets.DOCKERHUB_TOKEN }}
39+
- uses: actions/checkout@v2
40+
with:
41+
# Need tags for Makefile logic to work
42+
fetch-depth: 0
43+
- name: Build and Push Docker Images
44+
run: make push

0 commit comments

Comments
 (0)