Skip to content

Build and Publish COPR Bridge Container #13

Build and Publish COPR Bridge Container

Build and Publish COPR Bridge Container #13

---
name: Build and Publish COPR Bridge Container
"on":
schedule:
# Run every Monday at 06:00 UTC
- cron: '0 6 * * 1'
push:
branches: [main]
paths:
- 'ansible/roles/obs/files/copr_bridge.py'
- 'ansible/roles/obs/files/copr_bridge.containerfile'
pull_request:
branches: [main]
paths:
- 'ansible/roles/obs/files/copr_bridge.py'
- 'ansible/roles/obs/files/copr_bridge.containerfile'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/copr-bridge
jobs:
build:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
file: ./ansible/roles/obs/files/copr_bridge.containerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
sbom: false