Skip to content

Try AARNET mirror

Try AARNET mirror #20

name: Create and publish a Docker image
on:
push:
branches: ['main', 'testing/*']
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: '4.4.0-5.0.3'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- path: ./dockerfiles/rocker-seurat
image: ghcr.io/monashbioinformaticsplatform/rocker-ultra/rocker-seurat
version: 4.4.0-5.0.3
enabled: true
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ matrix.image }}
labels: |
org.opencontainers.image.source=https://github.com/monashbioinformaticsplatform/rocker-ultra
- name: Get current date
id: datestamp
run: |
echo "datestamp=$(date '+%F.%H%M%S')" >>$GITHUB_ENV
- name: Build and push Docker image (on push)
uses: docker/build-push-action@v3
if: ${{ matrix.enabled && (github.event_name != 'workflow_dispatch') }}
with:
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
context: ${{ matrix.path }}/${{ matrix.version }}
tags: |
${{ matrix.image }}:${{ matrix.version }}
${{ matrix.image }}:latest
labels: ${{ steps.meta.outputs.labels }}
file: ${{ matrix.path }}/${{ matrix.version }}/Dockerfile
- name: Build and push Docker image (on Run Workflow button)
uses: docker/build-push-action@v3
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
context: ./dockerfiles/rocker-seurat/${{ github.event.inputs.version }}
tags: |
ghcr.io/monashbioinformaticsplatform/rocker-ultra/rocker-seurat:${{ github.event.inputs.version }}
${{ matrix.image }}:latest
labels: ${{ steps.meta.outputs.labels }}
file: ./dockerfiles/rocker-seurat/${{ github.event.inputs.version }}/Dockerfile