version #138
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: Update HCL Code and Create Release | |
| on: | |
| repository_dispatch: | |
| types: | |
| - version | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| - name: Set Version | |
| id: set_version | |
| run: echo "::set-output name=version::${{ github.event.client_payload.version }}" | |
| - name: Update yaml code | |
| id: update_yaml_code | |
| run: | | |
| file="docker-compose.yml" | |
| echo "Updating $file" | |
| version=${{ steps.set_version.outputs.version }} | |
| sed -i "s/image: secoda\/on-premise-frontend:[0-9.]*/image: secoda\/on-premise-frontend:$version/" "$file" | |
| sed -i "s/image: secoda\/on-premise-api:[0-9.]*/image: secoda\/on-premise-api:$version/" "$file" | |
| - name: Commit and Push Changes | |
| id: commit_and_push | |
| run: | | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "actions@github.com" | |
| git add . | |
| git commit -m "chore(version): bump to v${{ steps.set_version.outputs.version }}" | |
| git push | |
| echo "::set-output name=commit_hash::$(git rev-parse HEAD)" | |
| - name: Create Release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| commitish: ${{ steps.commit_and_push.outputs.commit_hash }} | |
| tag_name: v${{ steps.set_version.outputs.version }} | |
| release_name: v${{ steps.set_version.outputs.version }} | |
| draft: false |