Skip to content
This repository was archived by the owner on Feb 2, 2026. It is now read-only.

fix: Correct an ugly bug in handling of None state in change_archived… #50

fix: Correct an ugly bug in handling of None state in change_archived…

fix: Correct an ugly bug in handling of None state in change_archived… #50

name: Build & Push - Dev
# Automatically builds and pushes a multi-platform dev image based on commits involving key files in any branch
on:
push:
branches:
- "**"
paths:
- "empty_library/**"
- "cps/**"
- "scripts/**"
- "**/Dockerfile"
- "**/requirements.txt"
- "**/optional-requirements.txt"
- "**/compile_translations.sh"
- "koreader/**"
- "**/cps.py"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
# Run only for code pushes (already path-filtered) or manual dispatch
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
env:
IMAGE_TAG: placeholder
LOWER_REPO_NAME: placeholder
LOWER_REPO_OWNER: placeholder
steps:
- name: Checkout correct branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Set repo and owner names to lowercase
run: |
echo "LOWER_REPO_NAME=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "LOWER_REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Determine Docker Image Tag
id: tag
run: |
if [[ "${{ github.ref_name }}" == "main" ]]; then
echo "IMAGE_TAG=dev" >> $GITHUB_ENV
else
sanitized_branch=$(echo "${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9.-]/-/g')
echo "IMAGE_TAG=dev-${sanitized_branch}" >> $GITHUB_ENV
fi
- name: Set Build ID
run: echo "BUILD_ID=$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
- name: DockerHub Login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: GitHub Container Registry Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
provenance: false
context: .
file: ./Dockerfile
push: true
build-args: |
BUILD_DATE=${{ github.event.repository.updated_at }}
VERSION=${{ vars.CURRENT_DEV_VERSION }}-DEV_BUILD-${{ env.IMAGE_TAG }}-${{ vars.CURRENT_DEV_BUILD_NUM }}
BUILD_ID=${{ env.BUILD_ID }}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/autocaliweb:${{ env.IMAGE_TAG }}
ghcr.io/${{ env.LOWER_REPO_OWNER }}/${{ env.LOWER_REPO_NAME }}:${{ env.IMAGE_TAG }}
platforms: linux/amd64,linux/arm64
- name: Increment dev build number
uses: action-pack/increment@v2
id: increment
with:
name: "CURRENT_DEV_BUILD_NUM"
token: ${{ secrets.DEV_BUILD_NUM_INCREMENTOR_TOKEN }}