Skip to content

feat: CI

feat: CI #1

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
- image: backend
path: ./backend/Dockerfile
- image: media
path: ./media/Dockerfile
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3.6.0
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}
echo "tag=ghcr.io/${GITHUB_REPOSITORY}-${{ matrix.image }}:${BRANCH}-${COMMIT}" >> $GITHUB_OUTPUT
- name: Build and push image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
context: .
file: ./frontend/Dockerfile
tags: ${{ steps.vars.outputs.tag }}