Use dev branch for dev builds.

This commit is contained in:
SergeantPanda 2025-03-22 16:40:11 -05:00
parent fef4e556c7
commit b9cae416ec
3 changed files with 11 additions and 4 deletions

View file

@ -27,13 +27,15 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine image tag
id: set-tag
- name: Determine image tag and branch
id: set-tag-branch
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "TAG=latest" >> $GITHUB_ENV
echo "BRANCH=main" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
echo "TAG=dev" >> $GITHUB_ENV
echo "BRANCH=dev" >> $GITHUB_ENV
fi
- name: Convert repository name to lowercase
@ -46,6 +48,8 @@ jobs:
file: docker/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
build-args: |
BRANCH=${{ env.BRANCH }}
tags: |
ghcr.io/${{ env.REPO_NAME }}:${{ env.TAG }}
ghcr.io/${{ env.REPO_NAME }}:${{ github.sha }}

View file

@ -1,5 +1,8 @@
FROM python:3.13-slim AS builder
# Define build argument with default value of "main"
ARG BRANCH=main
ENV PATH="/dispatcharrpy/bin:$PATH" \
VIRTUAL_ENV=/dispatcharrpy \
DJANGO_SETTINGS_MODULE=dispatcharr.settings \
@ -24,7 +27,7 @@ RUN apt-get update && \
nodejs && \
python -m pip install virtualenv && \
virtualenv /dispatcharrpy && \
git clone https://github.com/Dispatcharr/Dispatcharr /app && \
git clone -b ${BRANCH} https://github.com/Dispatcharr/Dispatcharr /app && \
cd /app && \
rm -rf .git && \
cd /app && \

View file

@ -1,3 +1,3 @@
#!/bin/bash
docker build -t dispatcharr/dispatcharr:dev -f Dockerfile ..
docker build --build-arg BRANCH=dev -t dispatcharr/dispatcharr:dev -f Dockerfile ..