diff --git a/.github/workflows/platform-deploy.yml b/.github/workflows/platform-deploy.yml index 77fad7ac..84689ff8 100644 --- a/.github/workflows/platform-deploy.yml +++ b/.github/workflows/platform-deploy.yml @@ -100,6 +100,39 @@ jobs: run: | mkdir -p ~/.ansible/roles cp -r ansible/roles/* ~/.ansible/roles/ + # Update platform version in network config + - name: Update platform version in network config + run: | + # Update dashmate_version + sed -i "s/dashmate_version: .*/dashmate_version: ${{ github.event.inputs.platform_version }}/" networks/${{ github.event.inputs.network }}.yml + + # Update platform service image versions + sed -i "s/drive_image: dashpay\/drive:[^ ]*/drive_image: dashpay\/drive:${{ github.event.inputs.platform_version }}/" networks/${{ github.event.inputs.network }}.yml + sed -i "s/dapi_image: dashpay\/dapi:[^ ]*/dapi_image: dashpay\/dapi:${{ github.event.inputs.platform_version }}/" networks/${{ github.event.inputs.network }}.yml + + echo "Updated network config:" + grep -E "(dashmate_version|drive_image|dapi_image)" networks/${{ github.event.inputs.network }}.yml + + # Commit and push updated config back to repository + - name: Commit and push updated network config + run: | + cd networks + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + + # Check if there are changes to commit + if git diff --quiet; then + echo "No changes to commit" + else + git add ${{ github.event.inputs.network }}.yml + git commit -m "Update ${{ github.event.inputs.network }} platform version to ${{ github.event.inputs.platform_version }} + + 🤖 Generated with [GitHub Actions](https://github.com/dashpay/dash-network-deploy/actions) + + Co-Authored-By: GitHub Actions "Add commentMore actions + git push origin main + echo "Successfully pushed updated config to repository" + fi # Run platform deployment - name: Run Platform Deployment