Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4767bb1
build: add ci build image yml
lethanhdat762003 Jan 19, 2026
b2eac22
feat: add tag
lethanhdat762003 Jan 19, 2026
309b62d
Merge pull request #85 from Space-DF/build/add-cd-build-image-yml
lethanhdat762003 Jan 19, 2026
441291c
fix: add service path in dockerfile
lethanhdat762003 Jan 19, 2026
dc8bc10
Merge pull request #86 from Space-DF/fix/add-service-path-dockerfile
lethanhdat762003 Jan 19, 2026
84dece6
fix: correct service path
lethanhdat762003 Jan 19, 2026
37a9a8f
Merge pull request #87 from Space-DF/fix/correct-service-path
lethanhdat762003 Jan 19, 2026
a8d4e7c
fix: correct cd build image
lethanhdat762003 Jan 19, 2026
d7dcd30
Merge pull request #88 from Space-DF/fix/correct-cd-build-image
lethanhdat762003 Jan 19, 2026
0b9209a
chore: change the secret to build args in dockerfile configuration
lethanhdat762003 Jan 19, 2026
7c566e6
Merge pull request #89 from Space-DF/chore/change-secrets-to-build-args
lethanhdat762003 Jan 19, 2026
84e1896
fix: correct secret for building
lethanhdat762003 Jan 19, 2026
1120d67
fix: add prefix for secret
lethanhdat762003 Jan 19, 2026
de95fa5
fix: change github token to pat
lethanhdat762003 Jan 20, 2026
cfdcd82
Merge pull request #90 from Space-DF/fix/change-gh-token-to-pat
lethanhdat762003 Jan 20, 2026
2b34bc1
fix: correct path
lethanhdat762003 Jan 20, 2026
5b8c3e9
fix: docker build for private django-common-utils dependency
lethanhdat762003 Jan 20, 2026
a5e89dd
build: update cd build image to release
lethanhdat762003 Jan 20, 2026
b8bc8db
build: update cd condition for releasing
lethanhdat762003 Jan 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
## What?
Explain the changes you've made
## Why?
The “why” tells us what business or engineering goal this change achieves
## How?

## Testing?
[ ] Functional Testing

[ ] Security

[ ] Performance
<!-- Explain the changes you've made in this pull request. Provide a brief summary of the features, bug fixes, or refactors included. -->

[ ] Error Handling
## Why?

[ ] Code Quality
<!-- Describe the business or technical reason behind these changes. What goal does this PR achieve? -->

[ ] Documentation
## How?

[ ] Database
<!-- Detail how the changes were implemented. Include specifics on the code, technologies, or processes used. -->

[ ] Deployment
## Testing?

[ ] Final Review
- [ ] Functional Testing
- [ ] Security
- [ ] Performance
- [ ] Error Handling
- [ ] Code Quality
- [ ] Documentation
- [ ] Database
- [ ] Deployment
- [ ] Final Review

## Anything Else?

<!-- Add any further context, suggestions, or future considerations. -->
52 changes: 52 additions & 0 deletions .github/workflows/cd-build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build & Publish Docker Image

on:
release:
types: [published]

jobs:
deploy:
if: github.event.release.target_commitish == 'main'
name: Build & Deploy spacedf-backend Docker Image
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

# Login to GHCR
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Generate Docker metadata
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}},value=${{ github.event.release.tag_name }}
type=semver,pattern={{major}}.{{minor}},value=${{ github.event.release.tag_name }}
type=semver,pattern={{major}},value=${{ github.event.release.tag_name }}

# Build & Push image
- name: Build & Push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
secrets: |
github_token=${{ secrets.GH_PAT }}
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
FROM python:3.10-alpine

ENV PYTHONUNBUFFERED=1
ENV DJANGO_SETTINGS_MODULE="auth_service.settings"

# Allows docker to cache installed dependencies between builds
RUN apk add build-base libffi-dev curl
COPY ./auth-service/requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY ./django-common-utils django-common-utils
RUN pip install ../django-common-utils
RUN apk add --no-cache \
build-base \
libffi-dev \
curl \
git

# Adds our application code to the image
COPY ./auth-service auth-service
# Install private repo using BuildKit secret
RUN --mount=type=secret,id=github_token \
pip install --no-cache-dir \
git+https://$(cat /run/secrets/github_token)@github.com/Space-DF/django-common-utils.git@dev

WORKDIR /auth-service

EXPOSE 80
WORKDIR /app

ENV DJANGO_SETTINGS_MODULE="auth_service.settings"
COPY . .
RUN pip install -r ./requirements.txt

RUN ["chmod", "+x", "./docker-entrypoint.sh"]

Expand Down