Add Gitea Actions workflow to build and push Docker image

Builds the deb Dockerfile and pushes to Gitea container registry.
Requires REGISTRY_USER and REGISTRY_PASSWORD secrets.
This commit is contained in:
2026-03-10 20:53:54 -07:00
parent a5d326dbc7
commit 89b9e56349

View File

@@ -0,0 +1,43 @@
name: Build and Push Docker Image
on:
push:
branches: [master]
workflow_dispatch:
env:
REGISTRY: git.johnogle.info
IMAGE_NAME: johno/protonmail-bridge-docker
jobs:
build-deb:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Get bridge version
id: version
run: |
VERSION=$(cat deb/PACKAGE | grep -oP '\d+\.\d+\.\d+' | head -1 || echo "latest")
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Build and push (deb)
uses: docker/build-push-action@v5
with:
context: ./deb
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
platforms: linux/amd64