diff --git a/.github/actions/ssm_execute/action.yml b/.github/actions/ssm_execute/action.yml index 804952c3..9a6a5e09 100644 --- a/.github/actions/ssm_execute/action.yml +++ b/.github/actions/ssm_execute/action.yml @@ -13,6 +13,9 @@ inputs: total_timeout: description: "Total timeout for the command execution" default: "1800" + ignore_errors: + default: "false" + description: "Whether to ignore errors during command execution" outputs: cmd_result: @@ -63,8 +66,12 @@ runs: echo "Command completed successfully." break elif [ "$STATUS" == "Failed" ] || [ "$STATUS" == "Cancelled" ]; then - echo "Command failed with status: $STATUS" - exit 1 + if [ "${{ inputs.ignore_errors }}" == "true" ]; then + echo "Command failed but errors are ignored." + break + else + echo "Command failed with status: $STATUS" + exit 1 else elapsed_time=$(( $(date +%s) - start_time )) if [ "$elapsed_time" -gt "$timeout" ]; then diff --git a/.github/workflows/deploy_package.yml b/.github/workflows/deploy_package.yml index 11f8ee1d..f901136b 100644 --- a/.github/workflows/deploy_package.yml +++ b/.github/workflows/deploy_package.yml @@ -50,20 +50,27 @@ jobs: echo "package_postfix=arm64.dev" >> $GITHUB_ENV fi - - name: Package install ${{ inputs.target }} + - name: Stop miden services uses: ./.github/actions/ssm_execute with: instance_id: ${{ secrets[inputs.instance_id] }} command: | - "sudo rm -f miden-*", "sudo systemctl stop miden-node", "sudo systemctl stop miden-faucet", - "sudo apt remove miden-node miden-faucet -y", + "sudo apt remove miden-node miden-faucet -y" + ignore_errors: true + + - name: Package install testnet + uses: ./.github/actions/ssm_execute + with: + instance_id: ${{ secrets[inputs.instance_id] }} + command: | + "sudo rm -f miden-*", "wget https://github.com/0xPolygonMiden/miden-node/releases/download/${{ inputs.tag }}/miden-faucet-${{ inputs.tag }}-${{ env.package_postfix }}", "wget https://github.com/0xPolygonMiden/miden-node/releases/download/${{ inputs.tag }}/miden-node-${{ inputs.tag }}-${{ env.package_postfix }}", "dpkg -i miden-node-${{ inputs.tag }}-${{ env.package_postfix }}", "dpkg -i miden-faucet-${{ inputs.tag }}-${{ env.package_postfix }}" - if: ${{ inputs.target }} == "testnet" + if: ${{ inputs.target }} != "devnet" - name: Download artifact uses: actions/download-artifact@v3 @@ -78,9 +85,6 @@ jobs: instance_id: ${{ secrets[inputs.instance_id] }} command: | "sudo rm -f miden-*", - "sudo systemctl stop miden-node", - "sudo systemctl stop miden-faucet", - "sudo apt remove miden-node miden-faucet -y", "dpkg -i miden-node-${{ inputs.tag }}-${{ env.package_postfix }}", "dpkg -i miden-faucet-${{ inputs.tag }}-${{ env.package_postfix }}" if: ${{ inputs.target }} == "devnet"