-
Notifications
You must be signed in to change notification settings - Fork 31
46 lines (42 loc) · 1.27 KB
/
main.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
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
tags: [ "v*.*.*" ]
pull_request:
branches: [ master ]
release:
types: ["created"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs: {}
# A workflow run is made up of one or more jobs that can run sequentially or in parallelname: ci
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
# Need tags for Makefile logic to work
fetch-depth: 0
- name: Build the Docker images
run: make image
deploy:
needs: [ "build" ]
runs-on: ubuntu-20.04
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v2
with:
# Need tags for Makefile logic to work
fetch-depth: 0
- name: Build and Push Docker Images
run: make push