Add ci workflow for building standalone docker image

This commit is contained in:
Timothy Hobbs 2024-06-03 17:20:14 +02:00
parent 43a71e89f7
commit 92513f4f3e
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,30 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Log in to Docker Hub
run: echo '${{ secrets.DOCKER_HUB_PASS }}' | docker login -u djangohelpdesk --password-stdin
- name: Build Docker image
run: cd standalone ; docker build -t djangohelpdesk/standalone:latest ..
- name: Push Docker image
run: docker push djangohelpdesk/standalone:latest
- name: Tag and push Docker image with year, month and Git SHA
run: docker tag djangohelpdesk/standalone:latest djangohelpdesk/standalone:$(date +%Y-%m)-$(git rev-parse --short HEAD) ; docker push djangohelpdesk/standalone:$(date +%Y-%m)-$(git rev-parse --short HEAD)
- name: If we are at a tag, add a tag to the current docker image push the image with the tag
if: startsWith(github.ref, 'refs/tags/')
run: docker tag djangohelpdesk/standalone:latest djangohelpdesk/standalone:${{ github.ref }} ; docker push djangohelpdesk/standalone:${{ github.ref }}

View File

@ -1,7 +1,9 @@
Django-Helpdesk Standalone Installation
=======================================
Installation
You can find standalone docker images at `djangohelpdesk/standalone:latest <https://hub.docker.com/r/djangohelpdesk/standalone/tags>`_.
Installation using docker-compose
------------
1. Clone the django-helpdesk repository: