sintonia/.github/workflows/dev-tools.yml

86 lines
2.4 KiB
YAML
Raw Normal View History

name: Dev Tools
on:
schedule:
- cron: "0 3 * * 0"
push:
branches: [main]
paths:
- ".github/workflows/dev-tools.yml"
- "**/packages.ini"
jobs:
docker-dev-image:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- distribution: ubuntu
release: focal
- distribution: debian
release: bullseye
- distribution: ubuntu
release: jammy
- distribution: debian
release: bookworm
env:
REGISTRY: ghcr.io
IMAGE_NAME: libretime-dev
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate packages list
run: |
2021-09-07 22:56:35 +02:00
tools/packages.py --dev --format line ${{ matrix.release }} \
2021-10-17 02:39:50 +02:00
analyzer \
2021-10-17 02:57:09 +02:00
playout \
shared \
> packages.list
- name: Generate Dockerfile
run: |
cat <<EOF >> Dockerfile
FROM ${{ matrix.distribution }}:${{ matrix.release }}
COPY packages.list packages.list
EOF
[[ "${{ matrix.release }}" == "focal" ]] && \
cat <<EOF >> Dockerfile
RUN DEBIAN_FRONTEND=noninteractive apt-get --quiet update && \
DEBIAN_FRONTEND=noninteractive apt-get --quiet install -y software-properties-common && \
add-apt-repository -y ppa:libretime/libretime
EOF
cat <<EOF >> Dockerfile
RUN DEBIAN_FRONTEND=noninteractive apt-get --quiet update && \
DEBIAN_FRONTEND=noninteractive apt-get --quiet install -y \
git \
python3 \
python3-pip \
python3-venv \
2022-08-13 20:21:19 +02:00
sudo \
$(cat packages.list)
2022-08-13 20:21:19 +02:00
RUN adduser --disabled-password --gecos '' --uid 1001 runner
RUN adduser runner sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
EOF
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
2022-03-03 12:07:16 +01:00
push: ${{ github.repository_owner == 'libretime' }}
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ matrix.release }}