Skip to content

added badge and update docker actions #6

added badge and update docker actions

added badge and update docker actions #6

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Create and publish a Docker image
on:
push:
branches: ['master']
# ENVIRONMENTAL-VARIABLES
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{github.repository}}
DOCKER_ALPINE_VERSION: 3.19
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- flavour-name: "mongodb"
flavour-package: "mongodb mongodb-tools"
- flavour-name: "redis"
flavour-package: "redis"
- flavour-name: "mysql"
flavour-package: "mysql-client"
- flavour-name: "postgresql"
flavour-package: "postgresql-client"
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.flavour-name }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
ALPINE_VERSION=${{ env.DOCKER_ALPINE_VERSION }}
DATABASE_FLAVOUR=${{ matrix.flavour-package }}