Skip to content

Update python requirements and create slim docker image #422

Update python requirements and create slim docker image

Update python requirements and create slim docker image #422

Workflow file for this run

name: Build scpca-tools images
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: alexslemonade/scpcatools
jobs:
build_slim:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker login
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build slim image
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:docker"
file: scpcatools_slim.Dockerfile
tags: scpcatools-slim
outputs: type=docker,dest=/tmp/scpcatools-slim.tar # output for sharing
cache-from: type=gha
cache-to: type=gha
- name: Upload slim image artifact
uses: actions/upload-artifact@v3
with:
name: slim-image
path: /tmp/scpcatools-slim.tar
build_and_push_matrix:
runs-on: ubuntu-22.04
needs: build_and_push_slim

Check failure on line 52 in .github/workflows/build-docker.yaml

View workflow run for this annotation

GitHub Actions / Build scpca-tools images

Invalid workflow file

The workflow is not valid. .github/workflows/build-docker.yaml (Line: 52, Col: 12): Job 'build_and_push_matrix' depends on unknown job 'build_and_push_slim'.
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- dockerfile: Dockerfile
suffix: ""
- dockerfile: scpcatools_slim.Dockerfile
suffix: "-slim"
steps:
- name: Download slim image artifact
uses: actions/download-artifact@v3
with:
name: slim-image
path: /tmp
- name: Load slim image
run: docker load --input /tmp/scpcatools-slim.tar
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker login
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: suffix=${{ matrix.suffix }},onlatest=true
tags: |
type=semver,pattern={{raw}}
type=edge,branch=main
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:docker"
file: ${{ matrix.dockerfile }}
push: ${{ github.event_name == 'push' }}
outputs: type=docker,dest=/tmp/slim.tar # output for sharing
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha