Skip to content

add container build for arm #32

add container build for arm

add container build for arm #32

Workflow file for this run

name: CI Pipeline
on:
pull_request:
types: [opened, synchronize]
push:
branches: [main]
jobs:
code-quality:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
pip install --upgrade pip pylint
pip install .[dev]
- name: check black formating
run: |
black --check --diff --config ./pyproject.toml .
- name: lint changed and added files
run: |
pylint --rcfile=.pylintrc --fail-under 9 shiny_invoice/
build-container:
runs-on: ubuntu-latest
# needs: deploy
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64
env:
REGISTRY_IMAGE: shiny_invoice
permissions:
packages: write
contents: read
steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build images
uses: docker/build-push-action@v5
with:
context: .
# push: true
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ env.REGISTRY_IMAGE }}:dev
# ghcr.io/${{ github.repository_owner }}/${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}
# ghcr.io/${{ github.repository_owner }}/${{ env.REGISTRY_IMAGE }}:latest