Testing forgejo actions
Some checks are pending
Build and Deploy Docker Image / build-and-push (push) Waiting to run

This commit is contained in:
Jeremy Karst 2025-04-10 16:33:10 -04:00
parent d4b6160a61
commit f3b66b336d
2 changed files with 72 additions and 0 deletions

View file

@ -0,0 +1,50 @@
name: Build and Deploy Docker Image
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Forgejo Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_SERVER_URL }}/${{ env.GITHUB_REPOSITORY_OWNER }}
username: ${{ env.GITHUB_ACTOR }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.GITHUB_SERVER_URL }}/${{ env.GITHUB_REPOSITORY_OWNER }}/osg
tags: |
type=raw,value=latest
type=raw,value=${{ github.sha }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./osg.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

22
docker-compose.yml Normal file
View file

@ -0,0 +1,22 @@
name: open-signature-generator
services:
osg:
image: https://code.karsttech.com/jeremy/open-signature-generator:latest
environment:
DOCKER: "true"
HOSTPREFIX: "osg.jkdev.org"
PYTHONUNBUFFERED: "1"
ports:
- "8312:8080"
volumes:
- sqlite-database:/data
restart: unless-stopped
volumes:
sqlite-database: