161 lines
2.7 KiB
Markdown
161 lines
2.7 KiB
Markdown
# CI/CD
|
|
|
|
## Overview
|
|
|
|
SilverLinux provides CI/CD through globally enabled Gitea Actions and a self-hosted runner. Package publishing is operational; application deployment to Windows IIS and Linux targets remains future work.
|
|
|
|
---
|
|
|
|
## Gitea Actions
|
|
|
|
Gitea Actions is enabled in Gitea's `app.ini` and is available globally.
|
|
|
|
Status:
|
|
|
|
```text
|
|
Operational
|
|
```
|
|
|
|
---
|
|
|
|
## Self-Hosted Runner
|
|
|
|
| Property | Value |
|
|
| --- | --- |
|
|
| Location | `/srv/docker/gitea-runner` |
|
|
| Image | `gitea/act_runner:latest` |
|
|
| Runner name | `silverlinux-runner` |
|
|
| Runner type | Global Runner |
|
|
| Status | Operational |
|
|
|
|
Runner labels:
|
|
|
|
* `ubuntu-latest`
|
|
* `ubuntu-24.04`
|
|
* `ubuntu-22.04`
|
|
|
|
The global runner can execute Actions workflows for repositories hosted by the SilverLinux Gitea instance.
|
|
|
|
---
|
|
|
|
## Silver 2.0 Package Publishing
|
|
|
|
Workflow:
|
|
|
|
```text
|
|
.gitea/workflows/package.yml
|
|
```
|
|
|
|
The workflow runs when both conditions are satisfied:
|
|
|
|
1. Code is pushed to the `net-8-version` branch.
|
|
2. The commit message contains `[Package]`.
|
|
|
|
Example commit message:
|
|
|
|
```text
|
|
Package Silver 2.0 libraries [Package]
|
|
```
|
|
|
|
Pipeline steps:
|
|
|
|
1. Check out the repository.
|
|
2. Install the .NET 8 SDK.
|
|
3. Restore the solution.
|
|
4. Build the solution using the `Deploy` configuration.
|
|
5. Pack the NuGet packages.
|
|
6. Push the packages to BaGet.
|
|
|
|
NuGet feed:
|
|
|
|
```text
|
|
https://nuget.silveressence.net/v3/index.json
|
|
```
|
|
|
|
---
|
|
|
|
## Operational Flow
|
|
|
|
```text
|
|
Git push
|
|
-> Gitea Actions
|
|
-> silverlinux-runner
|
|
-> dotnet restore
|
|
-> dotnet build
|
|
-> dotnet pack
|
|
-> BaGet package publish
|
|
```
|
|
|
|
The complete workflow has been tested successfully and is operational.
|
|
|
|
---
|
|
|
|
## Secrets
|
|
|
|
Runner registration token:
|
|
|
|
```text
|
|
/srv/secrets/company.env
|
|
GITEA_RUNNER_REGISTRATION_TOKEN
|
|
```
|
|
|
|
BaGet publishing credential:
|
|
|
|
```text
|
|
Repository Settings -> Actions -> Secrets
|
|
BAGET_API_KEY
|
|
```
|
|
|
|
No credentials are stored in repositories. Infrastructure-level secrets belong in `company.env`; repository workflow secrets belong in Gitea Actions Secrets.
|
|
|
|
---
|
|
|
|
## Future Deployment Targets
|
|
|
|
### Windows IIS
|
|
|
|
Planned targets include ASP.NET Core, Blazor Server and Blazor Web App deployments.
|
|
|
|
```text
|
|
Publish -> Copy files -> Restart IIS site
|
|
```
|
|
|
|
Status: Planned
|
|
|
|
### Linux Containers
|
|
|
|
```text
|
|
Build image -> Push image -> Deploy stack
|
|
```
|
|
|
|
Status: Future
|
|
|
|
---
|
|
|
|
## Future Enhancements
|
|
|
|
* Automated tests
|
|
* Automated Windows IIS deployment
|
|
* Linux container deployment
|
|
* Release pipelines
|
|
* Multi-environment deployments
|
|
* Package publishing for additional repositories
|
|
|
|
---
|
|
|
|
## Related Services
|
|
|
|
* Gitea
|
|
* Gitea Actions Runner
|
|
* BaGet
|
|
* Portainer
|
|
* Nginx Proxy Manager
|
|
|
|
## Related Documentation
|
|
|
|
* gitea/README.md
|
|
* baget/README.md
|
|
* docs/server.md
|
|
* docs/security.md
|
|
* docs/secrets.md
|