added readme
This commit is contained in:
parent
9201d5924b
commit
5c253ef293
4 changed files with 60 additions and 15 deletions
2
.github/workflows/build-go.yml
vendored
2
.github/workflows/build-go.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Build Docker Container
|
||||
name: Build Go Binary
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
|
17
README.md
17
README.md
|
@ -1,17 +1,6 @@
|
|||
# Pipeline Component - Build
|
||||
|
||||
This component is responsible for building software artifacts.
|
||||
This repository contains pipeline components for building software. Currently, it includes the following components:
|
||||
|
||||
## Inputs
|
||||
|
||||
| Name | Description | Default | Required |
|
||||
|------|-------------|---------|:--------:|
|
||||
| source | The source directory to build | `./` | false |
|
||||
| target | The target directory to store the build artifacts | `./dist` | false |
|
||||
|
||||
## Usage
|
||||
|
||||
```yaml
|
||||
|
||||
|
||||
```
|
||||
- [Build Go](./build-go.md)
|
||||
- [Build and Push Docker](./build-and-push-docker.md)
|
||||
|
|
31
build-and-push-docker.md
Normal file
31
build-and-push-docker.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Build Docker Forgejo Action
|
||||
|
||||
This Action builds and pushes a Docker image using Kaniko. It supports custom Dockerfiles, build contexts, and private registry authentication.
|
||||
|
||||
## Inputs
|
||||
|
||||
| Input Name | Description | Required | Type | Default Value |
|
||||
|-------------|-----------------------------------------------|----------|--------|-----------------|
|
||||
| `dockerfile`| Path to the Dockerfile to be built. | No | string | `./Dockerfile` |
|
||||
| `context` | Build context directory. | No | string | `./` |
|
||||
| `tag` | Tag to apply to the built image. | Yes | string | |
|
||||
| `registry` | Registry to push the image to. | Yes | string | |
|
||||
| `username` | Username for registry authentication. | Yes | string | |
|
||||
| `password` | Password for registry authentication. | Yes | string | |
|
||||
|
||||
## Usage
|
||||
|
||||
This action can be invoked using `workflow_call`. Below is an example of how to use it:
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
build:
|
||||
uses: [path/to/this-action@main](https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/build/.github/workflows/build-docker.yml@main)
|
||||
with:
|
||||
dockerfile: './Dockerfile.custom'
|
||||
context: './app'
|
||||
tag: 'my-registry.com/my-app:latest'
|
||||
registry: 'my-registry.com'
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
```
|
25
build-go.md
Normal file
25
build-go.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Build Go Forgejo Action
|
||||
|
||||
This Action builds a Go application. It compiles the specified Go source file and outputs the build artifacts to a target directory.
|
||||
|
||||
## Inputs
|
||||
|
||||
| Input Name | Description | Required | Type | Default Value |
|
||||
|-------------|-------------------------------------|----------|--------|-------------------------|
|
||||
| `source` | The path to the Go source file to build. | No | string | `./main.go` |
|
||||
| `target` | The output path for build artifacts. | No | string | `./dist/main` |
|
||||
| `go-version`| The Go version to use. | No | string | `>=1.23` |
|
||||
|
||||
## Usage
|
||||
|
||||
This action can be called from other workflows using `workflow_call`. Below is an example of how to invoke it:
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
build:
|
||||
uses: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/build/.github/workflows/build-go.yml@main
|
||||
with:
|
||||
source: './cmd/app/main.go'
|
||||
target: './build/app'
|
||||
go-version: '1.19'
|
||||
```
|
Loading…
Reference in a new issue