Skip to content

Final fixes to API wrapper and package metadata to pass devtools::che… #3

Final fixes to API wrapper and package metadata to pass devtools::che…

Final fixes to API wrapper and package metadata to pass devtools::che… #3

name: Build and Push Docker Image
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- flavor: cpu
base_image: ghcr.io/rocker-org/ml:latest
- flavor: gpu
base_image: ghcr.io/rocker-org/cuda:latest
steps:
- name: Free Disk Space
run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc
df -h
- name: Checkout repository
uses: actions/checkout@v4
- 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 GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate tags
id: meta
run: |
if [ "${{ matrix.flavor }}" == "cpu" ]; then
TAGS="ghcr.io/boettiger-lab/speciesnet:latest"
elif [ "${{ matrix.flavor }}" == "gpu" ]; then
TAGS="ghcr.io/boettiger-lab/speciesnet:cuda"
fi
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: .devcontainer/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
build-args: |
BASE_IMAGE=${{ matrix.base_image }}
tags: ${{ steps.meta.outputs.tags }}