Skip to content

[DEVOPS-1591] Add CI configuration for building images #127

[DEVOPS-1591] Add CI configuration for building images

[DEVOPS-1591] Add CI configuration for building images #127

Workflow file for this run

name: Build kernel images
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
base-linting:
name: base-linting
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Lint Dockerfile, Shell scripts, YAML
uses: github/super-linter@v4
env:
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Linters to enable
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
VALIDATE_DOCKERFILE_HADOLINT: true
VALIDATE_YAML: true
run-hooks:
name: Run pre-commit hooks
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install pre-commit
run: |
pip install --upgrade pip
pip install --upgrade pre-commit
- name: Run pre-commit hooks ✅
run: pre-commit run --all-files --hook-stage manual
build_images:
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
env:
# TODO: This should not be SHA, but branch / tag name
TAG: ${{ github.sha }}
steps:
- uses: actions/checkout@v3
- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ github.token }}
- run: |
task python:base:copy-files NBL_PYTHON_VERSION=3.9
task python:base:copy-files NBL_PYTHON_VERSION=3.10
task python:base:copy-files NBL_PYTHON_VERSION=3.11
task python:noteable:copy-files NBL_PYTHON_VERSION=3.9
task python:noteable:copy-files NBL_PYTHON_VERSION=3.10
task python:noteable:copy-files NBL_PYTHON_VERSION=3.11
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/setup-buildx-action@v2
# - name: Build base images
# uses: docker/bake-action@v3
# with:
# push: false
# targets: python_base
- name: Build python kernels
uses: docker/bake-action@v3
with:
push: false
targets: python,python_base