Skip to content

Commit

Permalink
#67 gh action to build demo image
Browse files Browse the repository at this point in the history
  • Loading branch information
dgk committed Apr 3, 2024
1 parent 7fa656d commit 4da1158
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
*
!business_logic
!docs/requirements.txt
!manage.py
!README.*
!requirements.*
!setup.*
!tests
!sites
!business_logic
!README.*
!manage.py
!tests
sites/dev/db.sqlite3
43 changes: 43 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build docker demo image

on:
push:
branches:
- feature/gh-docker-build

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- id: build-args
run: |
echo VCS_REF=`git rev-parse --short HEAD` >> $GITHUB_OUTPUT
echo BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` >> $GITHUB_OUTPUT
echo VERSION=`python -c 'from __future__ import print_function; import business_logic; print(business_logic.__version__)'` >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
build-args: |
VCS_REF=${{ steps.build-args.outputs.VCS_REF }}
BUILD_DATE=${{ steps.build-args.outputs.BUILD_DATE }}
VERSION=${{ steps.build-args.outputs.VERSION }}
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: dgksu/django-business-logic:demox
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ django-filter==23.2
django-nested-admin==4.0.2
django-polymorphic==3.1.0
django-treebeard==4.7
djangorestframework>=3.14.0
djangorestframework>=3.14.0,<3.15.0
lxml<5.0

0 comments on commit 4da1158

Please sign in to comment.