Skip to content

test

test #12

Workflow file for this run

name: CI
permissions:
contents: read
packages: write
on:
push:
branches: [main, devops]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
image: [frontend, backend, media]
include:
- image: frontend
path: ./frontend.dockerfile
context: .
- image: backend
path: ./backend/Dockerfile
context: ./backend
- image: media
path: ./media/Dockerfile
context: ./media
steps:
- uses: actions/checkout@v4
- uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- name: Extract branch and commit
id: vars
run: |
BRANCH=$(echo "${GITHUB_REF_NAME}" | tr '/' '-')
COMMIT=${GITHUB_SHA::7}
REPO_LOWER=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')
echo "tag=ghcr.io/${REPO_LOWER}-${{ matrix.image }}:${BRANCH}-${COMMIT}" >> $GITHUB_OUTPUT
- name: Build and push image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
push: true
file: ${{ matrix.path }}
context: ${{ matrix.context }}
tags: ${{ steps.vars.outputs.tag }}