Skip to content

Commit

Permalink
Update dockerimage.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasciput authored Jan 29, 2024
1 parent fc69abb commit 546a7e7
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,41 @@
name: Build and Push Docker Image

on:
push:
on:
push:
branches:
- 'main'
- main
tags:
- '*'

jobs:
build:
name: Build and Push Docker Django BIMS Image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Build and Publish the Docker Django Bims Image
uses: elgohr/Publish-Docker-Github-Action@v5
with:
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 }}
buildargs: BIMS_TAG=main
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"

0 comments on commit 546a7e7

Please sign in to comment.