caddy-shork/.forgejo/workflows/build.yml

40 lines
1.2 KiB
YAML

name: Auto Build caddy-shork podman Container
enable-email-notifications: true
on:
workflow_dispatch:
schedule:
- cron: '12 */3 * * *'
jobs:
build:
runs-on: pinp
env:
PACKAGE: caddy-shork
PODMAN_REGISTRY: git.shork.ch
REGISTRY_USER: docker-images
CADDY_APPS: |
github.com/caddy-dns/porkbun
github.com/mholt/caddy-l4/layer4
github.com/darkweak/souin
github.com/restic/caddy
github.com/abiosoft/caddy-exec
steps:
# - name: Install dependencies
# shell: sh
# run: |
# apk add --no-cache git nodejs npm bash sed curl jq podman
- uses: actions/checkout@v3
- name: Build and push image
run: |
xcaddy_cmd=""
for app in $CADDY_APPS; do xcaddy_cmd+=" --with $app"; done
escaped_cmd=$(printf '%s\n' "$xcaddy_cmd" | sed 's/[\/&]/\\&/g')
sed -i "s|\#\$XCADDY_APPS|$escaped_cmd|g" Containerfile
podman build --build-arg NPROC=1 -t $PODMAN_REGISTRY/$REGISTRY_USER/$PACKAGE:latest .
echo "${{ secrets.podman_PASSWORD }}" | podman login $PODMAN_REGISTRY -u $REGISTRY_USER --password-stdin
podman push --all-tags $PODMAN_REGISTRY/$REGISTRY_USER/$PACKAGE