diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 75f293c..fba669c 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,7 +13,8 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + IMAGE_NAME_APP: ${{ github.repository }}-app + IMAGE_NAME_WEB: ${{ github.repository }}-web jobs: build: @@ -37,11 +38,11 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata - id: meta + - name: Extract metadata (app) + id: meta_app uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_APP }} tags: | type=ref,event=branch type=ref,event=pr @@ -49,14 +50,38 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - - - name: Build and push Docker image + + - name: Build and push Docker image (app) + uses: docker/build-push-action@v6 + with: + context: .docker/app + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta_app.outputs.tags }} + labels: ${{ steps.meta_app.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Extract metadata (web) + id: meta_web + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_WEB }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=sha,prefix={{branch}}- + type=raw,value=latest,enable={{is_default_branch}} + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push Docker image (web) uses: docker/build-push-action@v6 with: - context: . + context: .docker/web platforms: linux/amd64,linux/arm64 push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta_web.outputs.tags }} + labels: ${{ steps.meta_web.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max