-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(release): implements a workflow to deploy to k8s
- Loading branch information
1 parent
a19e242
commit db0fbf7
Showing
3 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Deploy Kubernetes | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: "The environment to deploy to" | ||
required: true | ||
type: choice | ||
options: | ||
- staging | ||
- production | ||
app: | ||
description: "The app to deploy" | ||
required: true | ||
type: choice | ||
options: | ||
- console-web | ||
- console-api | ||
- provider-proxy | ||
appVersion: | ||
description: "The version of the app to deploy" | ||
required: true | ||
type: string | ||
chain: | ||
description: "The chain to deploy to" | ||
required: false | ||
type: choice | ||
options: | ||
- mainnet | ||
- sandbox | ||
workflow_call: | ||
inputs: | ||
environment: | ||
description: "The environment to deploy to" | ||
required: true | ||
type: string | ||
app: | ||
description: "The app to deploy" | ||
required: true | ||
type: string | ||
appVersion: | ||
description: "The version of the app to deploy" | ||
required: true | ||
type: string | ||
chain: | ||
description: "The chain to deploy to" | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Load kubeconfig | ||
id: op-load-secret | ||
uses: 1password/load-secrets-action@v2 | ||
with: | ||
export-env: true | ||
env: | ||
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | ||
KUBECONFIG: op://console/console.akash.network/kubeconfig | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v4.3.0 | ||
with: | ||
version: "latest" | ||
|
||
- name: Deploy with Helm | ||
run: | | ||
echo "$KUBECONFIG" > kubeconfig | ||
if [ -n "${{ inputs.chain }}" ]; then | ||
valuesFileArg="--values .helm/${{ inputs.app }}-values-${{ inputs.chain }}.yaml" | ||
fi | ||
chart_name=akash/${{ inputs.app }} | ||
release_name=${{ inputs.app }} | ||
if [ -n "${{ inputs.chain }}" ]; then | ||
release_name="${release_name}-${{ inputs.chain }}" | ||
fi | ||
helm repo add akash https://akash-network.github.io/helm-charts | ||
echo "executing: helm upgrade $release_name $chart_name --install --atomic -n ${{ inputs.environment }} --set appVersion=${{ inputs.appVersion }} --debug --kubeconfig kubeconfig $valuesFileArg" | ||
helm upgrade $release_name $chart_name --install --atomic -n ${{ inputs.environment }} --set appVersion=${{ inputs.appVersion }} --debug --kubeconfig kubeconfig $valuesFileArg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
chain: mainnet | ||
hostName: console-api-mainnet-staging.akash.network | ||
jobs: | ||
- name: top-up-deployments | ||
schedule: "0 * * * *" # 0 minutes past the hour | ||
command: | ||
- node | ||
- dist/console.js | ||
- top-up-deployments | ||
- name: refill-wallets | ||
schedule: "45 * * * *" # 45 minutes past the hour | ||
command: | ||
- node | ||
- dist/console.js | ||
- refill-wallets | ||
- name: cleanup-stale-deployments | ||
schedule: "30 10 * * 2" # 10:30 AM every Tuesday | ||
command: | ||
- node | ||
- dist/console.js | ||
- cleanup-stale-deployments | ||
- name: cleanup-stale-anonymous-users | ||
schedule: "0 9 * * 1" # 9:00 AM every Monday | ||
command: | ||
- node | ||
- dist/console.js | ||
- cleanup-stale-anonymous-users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
chain: sandbox | ||
hostName: console-api-sandbox-staging.akash.network |