Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
99 changes: 99 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Dependabot configuration for automated dependency updates
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates

version: 2
updates:
# Python backend dependencies (uv/pip)
- package-ecosystem: "pip"
directory: "/surfsense_backend"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
python-minor-patch:
patterns:
- "*"
update-types:
- "minor"
- "patch"
labels:
- "dependencies"
- "python"
commit-message:
prefix: "chore(deps)"

# Frontend web dependencies (pnpm/npm)
- package-ecosystem: "npm"
directory: "/surfsense_web"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
npm-minor-patch:
patterns:
- "*"
update-types:
- "minor"
- "patch"
labels:
- "dependencies"
- "javascript"
commit-message:
prefix: "chore(deps)"

# Browser extension dependencies (pnpm/npm)
- package-ecosystem: "npm"
directory: "/surfsense_browser_extension"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
extension-minor-patch:
patterns:
- "*"
update-types:
- "minor"
- "patch"
labels:
- "dependencies"
- "javascript"
- "extension"
commit-message:
prefix: "chore(deps)"

# GitHub Actions dependencies
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "chore(ci)"

# Docker dependencies
- package-ecosystem: "docker"
directory: "/surfsense_backend"
schedule:
interval: "monthly"
labels:
- "dependencies"
- "docker"
commit-message:
prefix: "chore(docker)"

- package-ecosystem: "docker"
directory: "/surfsense_web"
schedule:
interval: "monthly"
labels:
- "dependencies"
- "docker"
commit-message:
prefix: "chore(docker)"
127 changes: 90 additions & 37 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,87 @@ name: Docker Publish

on:
workflow_dispatch:
inputs:
push_backend:
description: 'Push backend image'
required: false
default: true
type: boolean
push_frontend:
description: 'Push frontend image'
required: false
default: true
type: boolean
release:
types: [published]
push:
branches: [main]
paths:
- 'surfsense_backend/Dockerfile'
- 'surfsense_web/Dockerfile'
- '.github/workflows/docker-publish.yml'

env:
REGISTRY: ghcr.io

jobs:
# build_and_push_backend:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
build_and_push_backend:
name: Build & Push Backend
runs-on: ubuntu-latest
if: |
github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' && inputs.push_backend)
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# - name: Log in to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for backend
id: meta-backend
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/surfsense_backend
tags: |
type=sha,prefix=
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type=sha,prefix= configuration creates a tag with just the SHA and no prefix (e.g., abc123). This is unconventional and may conflict with semantic version tags. Consider using type=sha,prefix=sha- to create tags like sha-abc123 for better clarity and to avoid potential conflicts.

Suggested change
type=sha,prefix=
type=sha,prefix=sha-

Copilot uses AI. Check for mistakes.
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}

# - name: Build and push backend image
# uses: docker/build-push-action@v5
# with:
# context: ./surfsense_backend
# file: ./surfsense_backend/Dockerfile
# push: true
# tags: ghcr.io/${{ github.repository_owner }}/surfsense_backend:${{ github.sha }}
# platforms: linux/amd64,linux/arm64
# labels: |
# org.opencontainers.image.source=${{ github.repositoryUrl }}
# org.opencontainers.image.created=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
# org.opencontainers.image.revision=${{ github.sha }}
- name: Build and push backend image
uses: docker/build-push-action@v6
with:
context: ./surfsense_backend
file: ./surfsense_backend/Dockerfile
push: true
tags: ${{ steps.meta-backend.outputs.tags }}
labels: ${{ steps.meta-backend.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

build_and_push_frontend:
name: Build & Push Frontend
runs-on: ubuntu-latest
if: |
github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' && inputs.push_frontend) ||
github.event_name == 'push'
Comment on lines +82 to +85
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The frontend build job includes a push trigger but the backend build job doesn't. This creates an inconsistency - when Dockerfiles are modified via push to main, only the frontend will be built. Add github.event_name == 'push' to the backend job's condition to ensure both images are built when their Dockerfiles change.

Copilot uses AI. Check for mistakes.
permissions:
contents: read
packages: write
Expand All @@ -57,19 +99,30 @@ jobs:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for frontend
id: meta-frontend
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/surfsense_web
tags: |
type=sha,prefix=
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type=sha,prefix= configuration creates a tag with just the SHA and no prefix (e.g., abc123). This is unconventional and may conflict with semantic version tags. Consider using type=sha,prefix=sha- to create tags like sha-abc123 for better clarity and to avoid potential conflicts.

Suggested change
type=sha,prefix=
type=sha,prefix=sha-

Copilot uses AI. Check for mistakes.
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push frontend image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./surfsense_web
file: ./surfsense_web/Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/surfsense_web:${{ github.sha }}
tags: ${{ steps.meta-frontend.outputs.tags }}
labels: ${{ steps.meta-frontend.outputs.labels }}
platforms: linux/amd64,linux/arm64
labels: |
org.opencontainers.image.source=${{ github.repositoryUrl }}
org.opencontainers.image.created=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
org.opencontainers.image.revision=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
Loading