-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc69abb
commit 546a7e7
Showing
1 changed file
with
32 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |