Skip to content

Commit

Permalink
ci: add image_build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Sep 28, 2023
1 parent 6518233 commit 38807fc
Showing 1 changed file with 49 additions and 2 deletions.
51 changes: 49 additions & 2 deletions .github/workflows/image_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,58 @@ name: Container Image Build

on:
workflow_call:
inputs:
image_tags:
required: true
type: string
build_args:
required: true
type: string
registry:
required: false
type: string
default: "ghcr.io"
context:
required: false
type: string
default: "."
dockerfile:
required: false
type: string
default: "Dockerfile"
build_target:
required: false
type: string
default: ""
push:
required: false
type: boolean
default: true

jobs:
build_image:
name: Build Image
build-and-push-images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ inputs.registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push frontend
uses: docker/build-push-action@v4
with:
context: ${{ inputs.context }}
file: ${{ inputs.dockerfile }}
target: ${{ inputs.build_target }}
push: ${{ inputs.push }}
tags: ${{ inputs.image_tags }}
build-args: ${{ inputs.build_args }}

0 comments on commit 38807fc

Please sign in to comment.