Skip to content

Commit

Permalink
only deploy internal testnet if deploy version or genesis state chang…
Browse files Browse the repository at this point in the history
…es (#1842)
  • Loading branch information
galxy25 authored Mar 7, 2024
1 parent 9bfd1ff commit 322f2ac
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/cd-internal-testnet.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
name: Continuous Deployment (Internal Testnet)
# run after every successful CI job of new commits to the master branch
# if deploy version or config has changed
on:
workflow_run:
workflows: [Continuous Integration (Kava Master)]
types:
- completed

jobs:
changed_files:
runs-on: ubuntu-latest
# define output for first job forwarding output of changedInternalTestnetConfig job
outputs:
changedInternalTestnetConfig: ${{ steps.changed-internal-testnet-config.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get all changed internal testnet files
id: changed-internal-testnet-config
uses: tj-actions/changed-files@v42
with:
# Avoid using single or double quotes for multiline patterns
files: |
ci/env/kava-internal-testnet/**
# in order:
# enter standby (prevents autoscaling group from killing node during deploy)
# stop kava
# take ebs + zfs snapshots
# download updated binary and genesis
# reset application database state (only done on internal testnet)
reset-chain-to-zero-state:
needs: [changed_files]
# only start cd pipeline if last ci run was successful
if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event.workflow_run.conclusion == 'success' }} && needs.changed_files.outputs.changedInternalTestnetConfig == 'true'
uses: ./.github/workflows/cd-reset-internal-testnet.yml
with:
aws-region: us-east-1
Expand Down

0 comments on commit 322f2ac

Please sign in to comment.