Skip to content

Commit

Permalink
feat: add build PR flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Antti Viitala committed Dec 18, 2023
1 parent 0d84798 commit 3d95dca
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Build Django image in PR"

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- "*"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

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

- name: Build only
uses: docker/build-push-action@v4
id: build-image
env:
REGISTRY: ghcr.io/antvirf/railway_django_stack
with:
context: ./.
file: ./Dockerfile
push: false
tags: ${{env.REGISTRY}}:${{github.run_number}}
cache-from: type=gha
cache-to: type=gha,mode=max
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ This is a barebones Django-project with the following additions/updates:
- [`django-celery-results`](https://github.com/celery/django-celery-results) for viewing results of Celery tasks in Django Admin
- Uses [`python-decouple`](https://github.com/HBNetwork/python-decouple) to manage settings via environment varialbes
- Installs and runs with [`gunicorn`](https://github.com/benoitc/gunicorn)

## Variable configurations

| Variable | Description | Used by |
| -------- | ----------- | ------- |
`POSTGRES_HOST` | This should be the private URL of the Postgres service | Django, Celery
`POSTGRES_DB` | Sets the Postgres default database name | Django, Celery, Postgres
`POSTGRES_USER` | Sets the Postgres username | Django, Celery, Postgres
`POSTGRES_PASSWORD` | Sets the Postgres user's password | Django, Celery, Postgres
`REDIS_URL` | Configures the private URl of the Redis service | Django, Celery |

0 comments on commit 3d95dca

Please sign in to comment.