Skip to content

Build container: php-fpm-ttrss #337

Build container: php-fpm-ttrss

Build container: php-fpm-ttrss #337

Workflow file for this run

# SPDX-FileCopyrightText: Timothée Ravier <tim@siosm.fr>
# SPDX-License-Identifier: CC0-1.0
name: "Build container: php-fpm-ttrss"
env:
NAME: "php-fpm-ttrss"
REGISTRY: "quay.io/travier"
on:
pull_request:
branches:
- "main"
paths:
- "php-fpm-ttrss/**"
- ".github/workflows/php-fpm-ttrss.yml"
push:
branches:
- "main"
paths:
- "php-fpm-ttrss/**"
- ".github/workflows/php-fpm-ttrss.yml"
schedule:
- cron: "0 0 * * MON"
workflow_dispatch:
permissions: "read-all"
# Prevent multiple workflow runs from racing to ensure that pushes are made
# sequentialy for the main branch. Also cancel in progress workflow runs for
# pull requests only.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build-push-image:
runs-on: "ubuntu-24.04"
container:
image: "quay.io/travier/podman-action" # zizmor: ignore[unpinned-images]
options: "--security-opt=label=disable --privileged --user 0:0 --device=/dev/kvm --device=/dev/fuse"
steps:
- name: "Fixup GitHub homedir"
run: |
mkdir -p /github/home/.docker/
- name: "Checkout repo"
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: "Build container image"
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2.13
with:
context: ${{ env.NAME }}
image: ${{ env.NAME }}
tags: latest
containerfiles: ${{ env.NAME }}/Containerfile
layers: false
oci: true
- name: "Push to Container Registry"
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2.8
id: push
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
with:
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_SECRET }}
image: ${{ env.NAME }}
registry: ${{ env.REGISTRY }}
tags: latest
extra-args: |
--compression-format=zstd:chunked
--compression-level=19
- name: "Login to Container Registry"
uses: redhat-actions/podman-login@4934294ad0449894bcd1e9f191899d7292469603 # v1.7
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_SECRET }}
auth_file_path: /tmp/auth.json
- uses: sigstore/cosign-installer@7e8b541eb2e61bf99390e1afd4be13a184e9ebc5 # v3.10.1
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
- name: "Sign container image"
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
run: |
cosign sign -y --key env://COSIGN_PRIVATE_KEY "${{ env.REGISTRY }}/${{ env.NAME }}@${DIGEST}"
env:
COSIGN_EXPERIMENTAL: false
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
DIGEST: ${{ steps.push.outputs.digest }}