Keep Contract Alive #92
This file contains hidden or 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
| name: Keep Contract Alive | |
| on: | |
| schedule: | |
| # Run daily at 00:00 UTC (defense-in-depth for TTL) | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| extend-ttl: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libudev-dev libdbus-1-dev pkg-config | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/stellar | |
| ~/.cargo/.crates.toml | |
| ~/.cargo/.crates2.json | |
| key: stellar-cli-${{ runner.os }} | |
| - name: Install Stellar CLI | |
| run: | | |
| if ! command -v stellar &> /dev/null; then | |
| cargo install stellar-cli --locked | |
| fi | |
| env: | |
| CARGO_TERM_COLOR: always | |
| - name: Import secret key | |
| run: | | |
| stellar keys add testnet-user --secret-key <<< "${{ secrets.TESTNET_SECRET_KEY }}" | |
| - name: Extend contract TTL | |
| run: | | |
| stellar contract invoke \ | |
| --id ${{ secrets.TESTNET_CONTRACT_ID }} \ | |
| --network testnet \ | |
| --source testnet-user \ | |
| --send=yes \ | |
| -- extend_ttl |