-
Notifications
You must be signed in to change notification settings - Fork 19
41 lines (38 loc) · 1.21 KB
/
dockerimage.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
name: Build and Push Docker Image
on:
push:
branches:
- main
tags:
- '*'
jobs:
build-and-push-latest:
if: github.ref == 'refs/heads/main'
name: Build and Push Docker Image with Latest Tag
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Build and Publish the Docker Image as Latest
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: kartoza/kbims_uwsgi:latest
context: .
dockerfile: deployment/docker/Dockerfile
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
buildoptions: "--target prod"
build-and-push-tag:
if: startsWith(github.ref, 'refs/tags/')
name: Build and Push Docker Image with Tag Name
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Build and Publish the Docker Image with Tag Name
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: kartoza/kbims_uwsgi:${{ github.ref_name }}
context: .
dockerfile: deployment/docker/Dockerfile
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
buildoptions: "--target prod"