libretime/.github/workflows/dev-tools.yml
Jonas L e320ce204e
ci: reduce usage (#1804)
* ci: move analyzer jobs in a dedicated workflow

* ci: move worker jobs in a dedicated workflow

* ci: move legacy jobs in a dedicated workflow

* ci: move shared jobs in a dedicated workflow

* ci: move api-client jobs to dedicated workflow

* ci: remove unused test job

* ci: move api jobs in a dedicated workflow

* ci: move playout ci jobs in a dedicated workflow

* ci: remove unused test job

* ci: move test-with-database in api workflow

* ci: run playout on api-client changes

* ci: rename tools workflow to dev-tools

* ci: rename generic tests workflow to project

* ci: rename lint-pr workflow to pr

* ci: update python tests concurrency

* ci: update python caching keys

* ci: update website/docs trigger condition

* ci: update legacy trigger condition

* ci: readd cancel in progress

* ci :update api cache key
2022-04-25 15:27:10 +02:00

82 lines
2.2 KiB
YAML

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: bionic
- distribution: ubuntu
release: focal
- distribution: ubuntu
release: jammy
- distribution: debian
release: buster
- distribution: debian
release: bullseye
env:
REGISTRY: ghcr.io
IMAGE_NAME: libretime-dev
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate packages list
run: |
tools/packages.py --dev --format line ${{ matrix.release }} \
analyzer \
playout \
> packages.list
- name: Generate Dockerfile
run: |
cat <<EOF >> Dockerfile
FROM ${{ matrix.distribution }}:${{ matrix.release }}
COPY packages.list packages.list
EOF
[[ "${{ matrix.release }}" =~ "bionic|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 \
$(cat packages.list)
EOF
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.repository_owner == 'libretime' }}
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ matrix.release }}