Skip to content

Docker CI

Docker CI #26

Workflow file for this run

name: Docker CI
# Controls when the workflow will run
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
push:
branches: [ "main" ]
concurrency:
group: "python"
cancel-in-progress: true
jobs:
build-matrix:
runs-on: ubuntu-latest
steps:
- id: set-matrix
run: echo "version_matrix=$(curl https://www.python.org/ftp/python/ 2>/dev/null | grep -oP '\d+\.\d+\.\d+' | grep -v '2.' | awk '!seen[$0]++' | perl -pe 'chomp if eof' | jq -R -s -c 'split("\n")')" >> $GITHUB_OUTPUT
outputs:
version_matrix: ${{ steps.set-matrix.outputs.version_matrix }}
run:
needs: build-matrix
runs-on: ubuntu-latest
strategy:
matrix:
version: ${{ fromJson(needs.build-matrix.outputs.version_matrix) }}
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GHCR
run: |
echo ${{ secrets.GHCR_PAT }} | docker login ghcr.io -u PiMachineLearning --password-stdin
- name: Build images
run: |
cd $GITHUB_WORKSPACE
sudo apt-get install -y qemu-user-static binfmt-support
chmod +x main.sh
./main.sh ${{ matrix.version }}