0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 14:12:36 -05:00

Add matrix for docker build

This commit is contained in:
SorsOps 2024-05-10 14:01:08 +02:00
parent 0e94c9851a
commit 16c893fa60
No known key found for this signature in database
GPG key ID: E9EC78C740654016

View file

@ -2,11 +2,18 @@ name: Publish docker image
on: on:
push: push:
branches: [ token-studio-develop ] branches: [ tokens-studio-develop ]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
include:
- dockerfile: Dockerfile.backend
type: backend
- dockerfile: Dockerfile.frontend
type: frontend
permissions: permissions:
contents: read contents: read
packages: write packages: write
@ -24,20 +31,27 @@ jobs:
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GHCR_TOKEN }}
- name: Docker meta - name: Docker meta
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
tags: | tags: |
type=sha,format=long type=sha,format=long,prefix=${{matrix.type}}-
images: | images: |
ghcr.io/tokens-studio/token-flow ghcr.io/tokens-studio/tokens-studio-for-penpot
- name: prebuild
run: |
echo "Building ${{ matrix.type }} image"
./manage.sh build-${{matrix.type}}-bundle
mv ./bundles/${{matrix.type}} ./docker/images/bundle-${{matrix.type}}/
- name: Publish Docker images - name: Publish Docker images
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: ./docker/images
file: ./docker/images/${{ matrix.dockerfile }}
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}