Merge pull request #580 from brightpixel-dev/fix/issues-522-523-524-525 #117
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: Deploy to Testnet | |
| on: | |
| push: | |
| branches: [ main ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy: | |
| runs-on: namespace-profile-nursca | |
| if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
| outputs: | |
| deployment_summary: ${{ steps.summary.outputs.deployment_summary }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| profile: minimal | |
| override: true | |
| target: wasm32v1-none | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Install Stellar CLI | |
| run: cargo install --locked stellar-cli | |
| - name: Deploy contracts to testnet | |
| id: deploy | |
| env: | |
| STELLAR_TESTNET_DEPLOYER_SECRET: ${{ secrets.STELLAR_TESTNET_DEPLOYER_SECRET }} | |
| run: bash scripts/deploy-testnet.sh | |
| - name: Update README contract IDs | |
| run: bash scripts/update-testnet-readme.sh | |
| - name: Commit README updates | |
| run: | | |
| if git status --porcelain | grep -q "README.md"; then | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add README.md | |
| git commit -m "ci: update testnet contract ids [skip ci]" | |
| git push | |
| else | |
| echo "No README changes to commit." | |
| fi | |
| - name: Emit deployment summary | |
| id: summary | |
| run: | | |
| SUMMARY=$(tr -d '\n' < deploy-summary.json) | |
| echo "deployment_summary=${SUMMARY}" >> "$GITHUB_OUTPUT" |