30 lines
812 B
YAML
30 lines
812 B
YAML
name: Build Docker Container
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
source:
|
|
description: 'The source directory to build'
|
|
required: false
|
|
type: string
|
|
default: './'
|
|
tag:
|
|
description: 'The tag to apply to the built image'
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
build-go:
|
|
runs-on: docker
|
|
container:
|
|
image: docker:27.4.0-rc.2-dind-alpine3.20
|
|
steps:
|
|
- name: Clone Repository
|
|
run: git clone https://wf:${{ github.token }}@{{ github.server_url }}/{{ github.repository_owner }}/{{ github.repository }}.git
|
|
- name: Check Out Branch
|
|
run: |
|
|
cd <repo>
|
|
git checkout <branch-name>
|
|
- name: Build Docker Container
|
|
run: |
|
|
docker build -t ${{ inputs.tag }} ${{ inputs.source }}
|