Skip to content

Commit

Permalink
feat(deploy): implements multiple apps and sdl templating
Browse files Browse the repository at this point in the history
  • Loading branch information
ygrishajev committed Oct 11, 2024
1 parent d7adab4 commit 1752583
Show file tree
Hide file tree
Showing 18 changed files with 645 additions and 216 deletions.
3 changes: 0 additions & 3 deletions .akash/BLOCKLIST

This file was deleted.

1 change: 0 additions & 1 deletion .akash/DSEQ

This file was deleted.

1 change: 0 additions & 1 deletion .akash/PROVIDER

This file was deleted.

19 changes: 0 additions & 19 deletions .akash/STATUS

This file was deleted.

4 changes: 1 addition & 3 deletions .github/actions/cleanup-stale-orders/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ runs:

steps:
- name: Cleanup stale deployment requests
env:
PASSWORD: ${{ inputs.password }}
shell: bash
run: |
unset AKASH_DSEQ
Expand All @@ -26,7 +24,7 @@ runs:
if test -z "$LEASE_STATE" || [[ "$LEASE_STATE" == "closed" ]]; then
## === broadcast tx === ##
TX=$(echo "${PASSWORD}" | ${CLIENT} tx deployment close | jq -r '.txhash')
TX=$(echo "${{ inputs.password }}" | ${CLIENT} tx deployment close | jq -r '.txhash')
if test -z $TX; then
echo "No TX broadcasted!"
exit 1
Expand Down
23 changes: 9 additions & 14 deletions .github/actions/cleanup-stale-state/action.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
name: Cleanup stale state
description: Cleanup state .akash/{DSEQ,PROVIDER,STATUS} if deployment is inactive
description: Cleanup state .akash/project-name if deployment is inactive

inputs:
password:
description: 'Password to decrypt the wallet'
required: true
type: string
github_token:
description: 'GITHUB_TOKEN'
required: true
type: string
PROJECT_PATH:
project-path:
description: 'Path to the project'
required: true
type: string
project-name:
description: 'Project name (will be used as prefix for state files)'
required: false
default: 'app'
type: string

runs:
using: "composite"

steps:
- name: Close stale deployment
id: close-stale-deployment
env:
PASSWORD: ${{ inputs.password }}
shell: bash
run: |
echo "Closing stale deployment"
## === broadcast tx === ##
TX=$(echo "${PASSWORD}" | ${CLIENT} tx deployment close | jq -r '.txhash')
TX=$(echo "${{ inputs.password }}" | ${CLIENT} tx deployment close | jq -r '.txhash')
if test -z $TX; then
echo "No TX broadcasted!"
exit 1
Expand Down Expand Up @@ -57,9 +56,5 @@ runs:
run: |
echo "AKASH_DSEQ=" >> $GITHUB_ENV
echo "AKASH_PROVIDER=" >> $GITHUB_ENV
rm -vf ${{ inputs.PROJECT_PATH }}/.akash/DSEQ ${{ inputs.PROJECT_PATH }}/.akash/PROVIDER ${{ inputs.PROJECT_PATH }}/.akash/STATUS
rm -vrf ${{ inputs.project-path }}/.akash/${{ inputs.project-name }}
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ inputs.github_token }}
13 changes: 8 additions & 5 deletions .github/actions/close-all-active/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Close all active deployments
description: Close all active deployments

inputs:
project_path:
project-path:
description: 'Path to the project'
required: true
type: string
Expand All @@ -14,14 +14,17 @@ inputs:
description: 'GITHUB_TOKEN'
required: true
type: string
project-name:
description: 'Project name (will be used as prefix for state files)'
required: false
default: 'app'
type: string

runs:
using: "composite"

steps:
- name: Close all active deployments
env:
PASSWORD: ${{ inputs.password }}
shell: bash
run: |
unset AKASH_DSEQ
Expand All @@ -32,7 +35,7 @@ runs:
while read AKASH_DSEQ; do
export AKASH_DSEQ
## === broadcast tx === ##
TX=$(echo "${PASSWORD}" | ${CLIENT} tx deployment close | jq -r '.txhash')
TX=$(echo "${{ inputs.password }}" | ${CLIENT} tx deployment close | jq -r '.txhash')
if test -z $TX; then
echo "No TX broadcasted!"
exit 1
Expand Down Expand Up @@ -63,7 +66,7 @@ runs:
run: |
echo "AKASH_DSEQ=" >> $GITHUB_ENV
echo "AKASH_PROVIDER=" >> $GITHUB_ENV
rm -vf ${{ inputs.project_path }}/.akash/DSEQ ${{ inputs.project_path }}/.akash/PROVIDER ${{ inputs.project_path }}/.akash/STATUS
rm -vrf ${{ inputs.project-path }}/.akash/${{ inputs.project-name }}
- name: Commit & Push changes
uses: actions-js/push@master
Expand Down
20 changes: 9 additions & 11 deletions .github/actions/close-state-deployment/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Close state deployment
description: Close a single deployment based on the state (.akash/{DSEQ,PROVIDER})
description: Close a single deployment based on the state (.akash/project-name)

inputs:
project_path:
project-path:
description: 'Path for the project to deploy'
required: true
type: string
Expand All @@ -14,21 +14,24 @@ inputs:
description: 'GITHUB_TOKEN'
required: true
type: string
project-name:
description: 'Project name (will be used as prefix for state files)'
required: false
default: 'app'
type: string

runs:
using: "composite"

steps:
- name: Close deployment
id: close-deployment
env:
PASSWORD: ${{ inputs.password }}
shell: bash
run: |
echo "Closing deployment"
## === broadcast tx === ##
TX=$(echo "${PASSWORD}" | ${CLIENT} tx deployment close | jq -r '.txhash')
TX=$(echo "${{ inputs.password }}" | ${CLIENT} tx deployment close | jq -r '.txhash')
if test -z $TX; then
echo "No TX broadcasted!"
exit 1
Expand Down Expand Up @@ -58,9 +61,4 @@ runs:
run: |
echo "AKASH_DSEQ=" >> $GITHUB_ENV
echo "AKASH_PROVIDER=" >> $GITHUB_ENV
rm -vf ${{ inputs.project_path }}/.akash/DSEQ ${{ inputs.project_path }}/.akash/PROVIDER ${{ inputs.project_path }}/.akash/STATUS
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ inputs.github_token }}
rm -vrf ${{ inputs.project-path }}/.akash/${{ inputs.project-name }}
Loading

0 comments on commit 1752583

Please sign in to comment.