Skip to content

Build and push Cantaloupe docker image #18

Build and push Cantaloupe docker image

Build and push Cantaloupe docker image #18

Workflow file for this run

name: Build and push Cantaloupe docker image
on:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: docker-meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/dlcs/cantaloupe
tags: |
type=ref,event=pr
type=raw,value=5.0.6,priority=900,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=sha,format=long
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Check out code
id: checkout
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
tags: ${{ steps.docker-meta.outputs.tags }}
push: true