Deploy to Render #7
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 Render | |
| on: | |
| workflow_run: | |
| workflows: ["Backend CI"] | |
| types: [completed] | |
| branches: [main] | |
| jobs: | |
| deploy: | |
| if: github.event.workflow_run.conclusion == 'success' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Trigger Render deploy | |
| run: curl -fsS -X POST "${{ secrets.RENDER_DEPLOY_HOOK }}" | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| - name: Compute next tag | |
| id: bump | |
| run: | | |
| latest=$(git tag --sort=-v:refname | head -n1) | |
| latest=${latest:-v0.1.0} | |
| ver=${latest#v} | |
| IFS='.' read -r major minor patch <<< "$ver" | |
| patch=${patch:-0} | |
| patch=$((patch + 1)) | |
| echo "new_tag=v${major}.${minor}.${patch}" >> "$GITHUB_OUTPUT" | |
| - name: Create tag and release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.bump.outputs.new_tag }} | |
| target_commitish: main | |
| generate_release_notes: true | |
| prerelease: true # prerelease: ${{ !startsWith(steps.bump.outputs.new_tag, 'v1.') }} |