mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-10-29 19:13:36 +00:00
ci(build): simplify matrix
This commit is contained in:
18
.github/workflows/docker.yml
vendored
18
.github/workflows/docker.yml
vendored
@@ -20,13 +20,7 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
image: [backend, frontend]
|
||||||
- name: backend
|
|
||||||
dockerfile: docker/backend.Dockerfile
|
|
||||||
image: ${{ github.repository_owner }}/patchmon-backend
|
|
||||||
- name: frontend
|
|
||||||
dockerfile: docker/frontend.Dockerfile
|
|
||||||
image: ${{ github.repository_owner }}/patchmon-frontend
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
@@ -45,7 +39,7 @@ jobs:
|
|||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ matrix.image }}
|
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/patchmon-${{ matrix.image }}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
@@ -53,14 +47,14 @@ jobs:
|
|||||||
type=semver,pattern={{major}}
|
type=semver,pattern={{major}}
|
||||||
type=raw,value=latest,enable={{is_default_branch}}
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
|
||||||
- name: Build and push ${{ matrix.name }} image
|
- name: Build and push ${{ matrix.image }} image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ${{ matrix.dockerfile }}
|
file: docker/${{ matrix.image }}.Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=gha,scope=${{ matrix.name }}
|
cache-from: type=gha,scope=${{ matrix.image }}
|
||||||
cache-to: type=gha,mode=max,scope=${{ matrix.name }}
|
cache-to: type=gha,mode=max,scope=${{ matrix.image }}
|
||||||
|
|||||||
Reference in New Issue
Block a user