containerdesk/.github/workflows/docker-publish.yml
Michael Trip d7a9ba70d8 testing
2023-03-09 08:29:09 +01:00

60 lines
No EOL
1.7 KiB
YAML

name: Build & publish drill4net images
on:
schedule:
- cron: '39 15 * * *'
push:
branches: [ "main" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./mate/Dockerfile
image: ghcr.io/michaeltrip/containerdesk-mate
context: ./mate
- dockerfile: ./xfce/Dockerfile
image: ghcr.io/michaeltrip/containerdesk-xfce
context: ./xfce
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Log in to the Container registry
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GH_PACKAGE_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ matrix.image }}
- name: Build and push Docker image Containerdesk
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
with:
context: ${{ matrix.context }}
platforms: linux/arm64,linux/amd64
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max