Skip to content

Commit

Permalink
Add namespace (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 authored May 3, 2023
1 parent 0d8d536 commit 46de013
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ For more information on inputs, see the [API Documentation](https://developer.gi
- `version`: Optional, version of devnet chart from starship (default: `0.1.4`)
- `repo`: Optional, Helm repo to fetch the chart from (default: https://cosmology-tech.github.io/starship)
- `name`: Optional, Release name for the helm chart deployment (default: `starship-devnet`)
- `namespace`: Optional, Kubernetes namespace to which helm charts will be deployed. If not found, namespace will be created. (default: `starship`)
- `namespace`: Optional, Kubernetes namespace to which helm charts will be deployed. If not found, namespace will be created. (default: `ci-${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}`)
- `chart`: Optional, Name of the help chart to use. Recommended: use default (default: `starship/devnet`)

### Outputs
- `namespace`: Namespace where the devnet is deployed
- `name`: Name of the helm chart, same as `name` input

### Example workflow

Chreate a workflow (eg: `.github/workflows/create-osmosis-wasmd.yml`)
Expand Down
9 changes: 9 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ inputs:
description: "Helm chart release name for installing helm chart (default: starship-devnet)"
required: false
default: "starship-devnet"
namespace:
description: "Kubernetes namespace to deploy helm charts on (default: ci-{github.repository}-{github.workflow}-{github.ref} )"
required: false
default: ""

outputs:
namespace:
Expand Down Expand Up @@ -88,12 +92,17 @@ runs:
id: set-namespace
run: |
namespace="ci-${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}"
if [ -n "$INPUT_NAMESPACE" ]; then
namespace="$INPUT_NAMESPACE"
fi
namespace="${namespace// /-}"
namespace="${namespace//\//-}"
namespace=$(awk '{print tolower($0)}' <<< $namespace)
echo "Setting namespace to $namespace"
echo "namespace=$namespace" >> $GITHUB_OUTPUT
shell: bash
env:
INPUT_NAMESPACE: ${{ inputs.namespace }}

- name: Setup starship helm repo
run: |
Expand Down

0 comments on commit 46de013

Please sign in to comment.