initial
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
name: Extract chart name from repo name
|
||||||
|
description: Extracts the chart name from the repo name, based on the convention of helm-<chart-name>
|
||||||
|
inputs:
|
||||||
|
repo:
|
||||||
|
description: The full repository name (e.g., "helm-my-chart")
|
||||||
|
required: true
|
||||||
|
outputs:
|
||||||
|
chart-name:
|
||||||
|
description: The extracted chart name
|
||||||
|
value: ${{ steps.extract.outputs.suffix }}
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- id: extract
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
full_repo="${{ inputs.repo }}"
|
||||||
|
suffix="${full_repo##*helm-}"
|
||||||
|
echo "suffix=$suffix" >> $GITHUB_OUTPUT
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
name: "Extract namespace from repo name"
|
||||||
|
description: "Extracts the namespace name from the repo name, based on the convention of k_<namespace-name>"
|
||||||
|
inputs:
|
||||||
|
repo:
|
||||||
|
description: 'The repo name, get it from "github.repository"'
|
||||||
|
required: true
|
||||||
|
outputs:
|
||||||
|
namespace:
|
||||||
|
description: "The namespace name"
|
||||||
|
value: ${{ steps.extract.outputs.suffix }}
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- id: extract
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
full_repo="${{ inputs.repo }}"
|
||||||
|
suffix="${full_repo##*k_}"
|
||||||
|
echo "suffix=$suffix" >> $GITHUB_OUTPUT
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- ".gitea/actions/"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Increment tag
|
||||||
|
id: tag
|
||||||
|
uses: https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment@ef0c23189db33220a73022d8c29a27709d0df440 # 0.1.32
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
- name: Push tag
|
||||||
|
uses: https://gitea.t000-n.de/t.behrendt/actions/release-git-tag@47a1c635cfc76cfb4eeee3db0d0b89bf19007c7a # 0.2.3
|
||||||
|
with:
|
||||||
|
tag: ${{ steps.tag.outputs.new-tag }}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
# k_deploy_actions
|
||||||
|
|
||||||
|
Reusable actions for the k\_ repositories.
|
||||||
|
|
||||||
|
## Available Actions
|
||||||
|
|
||||||
|
### Extract Chart Name from Repository Name
|
||||||
|
|
||||||
|
Path: `./.gitea/actions/extract-chart-name-from-repo-name`
|
||||||
|
|
||||||
|
Extracts the chart name from repository names using the `helm-<chart-name>` convention.
|
||||||
|
|
||||||
|
#### Usage
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Extract chart name
|
||||||
|
id: chart_name
|
||||||
|
uses: https://gitea.t000-n.de/t.behrendt/.gitea/actions/extract-chart-name-from-repo-name
|
||||||
|
with:
|
||||||
|
repo: ${{ github.repository_name }} # e.g. "helm-my-service"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Inputs
|
||||||
|
|
||||||
|
| Parameter | Description | Required |
|
||||||
|
| --------- | ------------------------------------------- | -------- |
|
||||||
|
| `repo` | Full repository name (e.g. `helm-my-chart`) | Yes |
|
||||||
|
|
||||||
|
#### Outputs
|
||||||
|
|
||||||
|
| Output | Description |
|
||||||
|
| ------------ | ----------------------------------------------------------- |
|
||||||
|
| `chart-name` | Extracted chart name (e.g. `my-chart` from `helm-my-chart`) |
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
For `helm-user-service`, this action returns `user-service`.
|
||||||
|
|
||||||
|
### Extract Namespace from Repository Name
|
||||||
|
|
||||||
|
Path: `./.gitea/actions/extract-namespace-from-repo-name`
|
||||||
|
|
||||||
|
Extracts the namespace from repository names using the `k_<namespace-name>` convention.
|
||||||
|
|
||||||
|
#### Usage
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Extract namespace
|
||||||
|
id: namespace
|
||||||
|
uses: ./.gitea/actions/extract-namespace-from-repo-name
|
||||||
|
with:
|
||||||
|
repo: ${{ github.repository_name }} # e.g. "k_platform-service"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Inputs
|
||||||
|
|
||||||
|
| Parameter | Description | Required |
|
||||||
|
| --------- | ------------------------------------------- | -------- |
|
||||||
|
| `repo` | Repository name (e.g. `k_platform-service`) | Yes |
|
||||||
|
|
||||||
|
#### Outputs
|
||||||
|
|
||||||
|
| Output | Description |
|
||||||
|
| ----------- | ----------------------------------------------------------------------- |
|
||||||
|
| `namespace` | Extracted namespace (e.g. `platform-service` from `k_platform-service`) |
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
For `k_core-apps`, this action returns `core-apps`.
|
||||||
Reference in New Issue
Block a user