Skip to content

imatic/imatic-build-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Imatic Build Action

Builds docker-compose based project images and pushes them to registry.

All services with build key are built and tagged with provided tags. Tags and image names should be generated by using environment variables provided by this action. For example:

  • PROJECT_IMAGE - image name
  • PROJECT_VERSION - image version
services:
  frontend:
    image: ${PROJECT_IMAGE:-my-project-name}:${PROJECT_VERSION:-latest}
    build:
      context: .
      args:
        - MY_APP_VERSION=${PROJECT_VERSION:-latest}

These variables are also returned in output of this action as project-image and project-version respectively. Use these if you need to spin up built images in the workflow.

Options

You can specify following options in with section of this action:

  • registry - registry to push images to. Default is ghcr.io.
  • build - build images. Default is true.
  • push - push images to registry. Default is true.
  • docker_compose_file - path to docker-compose file. Default is docker-compose.yml.

Usage in workflow

An example usage of this action in build workflow.

name: Build Image

on:
  workflow_call:
  workflow_dispatch:
  push:
    branches: [main]

env:
  REGISTRY: ghcr.io

jobs:
  build_image:
    name: Build Image
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Login to GitHub Container Registry
        uses: docker/login-action@v3
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Build & push
        uses: imatic/imatic-build-action
        with:
          registry: ${{ env.REGISTRY }}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published