Create and publish GPU Docker images #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create and publish GPU Docker images | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: ["Create and publish Docker images"] | |
type: | |
- complete | |
jobs: | |
push_to_registry: | |
name: Build and push GPU Docker image to GitHub Packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Add SHORT_SHA env property with commit short sha | |
run: echo "SHORT_SHA=`git rev-parse --short HEAD`" >> $GITHUB_ENV | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
with: | |
driver: docker # defaults to "docker-containerized" | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Published pipeline images | |
# GPU ONLY IMAGE - based on pre-built pipeline-base image | |
- name: Extract metadata for pipeline-gpu | |
id: meta-gpu | |
uses: docker/metadata-action@v3 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
ghcr.io/auscalabledronecloud/pipeline-gpu | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=tag | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=sha | |
${{ env.SHORT_SHA }}-${{ github.run_number }} | |
- name: Build and push pipeline-gpu image | |
uses: docker/build-push-action@v2 | |
with: | |
build-args: | | |
BASE_CONTAINER=minimal-notebook | |
context: ./base | |
push: true | |
tags: | | |
ghcr.io/auscalabledronecloud/pipeline-gpu:latest | |
${{ steps.meta-gpu.outputs.tags }} | |
labels: ${{ steps.meta-base.outputs.labels }} | |
- name: Extract metadata for pipeline-ml | |
id: meta-ml | |
uses: docker/metadata-action@v3 | |
with: | |
images: ghcr.io/auscalabledronecloud/pipeline-ml | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=tag | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=sha | |
${{ env.SHORT_SHA }}-${{ github.run_number }} | |
- name: Build and push pipeline-ml image | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./ml | |
push: true | |
tags: | | |
ghcr.io/auscalabledronecloud/pipeline-ml:latest | |
${{ steps.meta-ml.outputs.tags }} | |
labels: ${{ steps.meta-ml.outputs.labels }} |