Skip to content

chore: use strategy matrix #63

chore: use strategy matrix

chore: use strategy matrix #63

name: Build combine-discord and publish to ghcr.io
on:
push:
branches:
- combine-discord
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
strategy:
matrix:
include:
- runs-on: ubuntu-latest
arch: amd64
platforms: linux/amd64
runs-on: ${{ matrix.runs-on }}
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v4
with:
submodules: recursive
# - name: Get image repository short commit
# id: version
# run: |
# echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c 1-8)" >> $GITHUB_OUTPUT
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,suffix=${{ matrix.arch }}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./packages/radio/docker/discord/Dockerfile
platforms: ${{ matrix.platforms }}
# tags: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.SHORT_SHA }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true