Skip to content

Added matrix build for both Alpine and Debian images. #17

Added matrix build for both Alpine and Debian images.

Added matrix build for both Alpine and Debian images. #17

Workflow file for this run

name: Build Docker image
on:
push:
workflow_dispatch:
env:
registry: ghcr.io
jobs:
Build_image:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
distro:
- Alpine
- Ubuntu
steps:
- 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: Declare image name (${{ env.image }})
run: image=${GITHUB_REPOSITORY,,} && echo image=${image%-*} | tee -a "$GITHUB_ENV"
- name: Build Docker image (${{ matrix.distro }})
run: docker build --tag ${tag=${{ env.registry }}/${{ env.image }}:${distro,,}} - <$distro.Dockerfile
&& <<<tag=$tag tee -a "$GITHUB_ENV"
env:
distro: ${{ matrix.distro }}
- name: Push Docker image (${{ env.tag }})
run: docker push ${{ env.tag }}