Skip to content

Merge pull request #1232 from devmocrea/feat/1177-1178-1179-1180-secu… #311

Merge pull request #1232 from devmocrea/feat/1177-1178-1179-1180-secu…

Merge pull request #1232 from devmocrea/feat/1177-1178-1179-1180-secu… #311

Workflow file for this run

name: Docker Build & Push

Check failure on line 1 in .github/workflows/docker.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker.yml

Invalid workflow file

(Line: 47, Col: 17): Unrecognized named-value: 'id'. Located at position 1 within expression: id.meta.outputs.tags, (Line: 48, Col: 19): Unrecognized named-value: 'id'. Located at position 1 within expression: id.meta.outputs.labels
on:
push:
branches: [ main, develop ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
component: [ backend, frontend ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.component }}
tags: |
type=ref,event=branch
type=sha,format=long
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./${{ matrix.component }}
push: true
tags: ${{ id.meta.outputs.tags }}
labels: ${{ id.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max