64 lines
1.6 KiB
Markdown
64 lines
1.6 KiB
Markdown
# GitHub Actions Workflows
|
|
|
|
This directory contains template GitHub Actions workflows for CI/CD.
|
|
|
|
## Setup Instructions
|
|
|
|
### For Standalone Repository
|
|
Copy the workflow files to `.github/workflows/` in your repository root:
|
|
```bash
|
|
mkdir -p .github/workflows
|
|
cp .github-template/workflows/* .github/workflows/
|
|
```
|
|
|
|
### For Monorepo
|
|
1. Copy the workflow files to your monorepo's `.github/workflows/` directory
|
|
2. Update the path filters in each workflow file to match your app location
|
|
3. Update the `working-directory` and `context` paths as indicated in the comments
|
|
|
|
Example for an app at `apps/my-grpc-service/`:
|
|
```yaml
|
|
# Add path filters
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'apps/my-grpc-service/**'
|
|
|
|
# Update working directory for Go commands
|
|
- name: Run tests
|
|
run: go test -v ./...
|
|
working-directory: ./apps/my-grpc-service
|
|
|
|
# Update Docker context
|
|
- name: Build Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./apps/my-grpc-service
|
|
```
|
|
|
|
## Workflows Included
|
|
|
|
### ci.yml
|
|
- Runs on push/PR to main/develop branches
|
|
- Tests, linting, building, and coverage reporting
|
|
- Supports Go 1.23
|
|
- Uses buf for protobuf generation
|
|
|
|
### docker.yml
|
|
- Builds and pushes Docker images
|
|
- Multi-platform builds (amd64/arm64)
|
|
- Pushes to GitHub Container Registry
|
|
- Triggered on pushes to main and tags
|
|
|
|
## Required Secrets
|
|
|
|
No additional secrets are required - workflows use:
|
|
- `GITHUB_TOKEN` (automatically provided)
|
|
- GitHub Container Registry (ghcr.io)
|
|
|
|
## Customization
|
|
|
|
- Adjust Go version in ci.yml
|
|
- Change registry in docker.yml (e.g., Docker Hub, AWS ECR)
|
|
- Add deployment jobs for your platform
|
|
- Add security scanning steps |