Merge pull request #1285 from FalkorDB/1284-bump-next-to-1557 #128
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: Release image to DockerHub | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| cypher_version: | |
| description: 'text-to-cypher version to release' | |
| required: true | |
| default: 'v0.1.5' | |
| push: | |
| tags: ["v*.*.*"] | |
| branches: | |
| - main | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up variables | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "CYPHER_VERSION=${{ github.event.inputs.cypher_version }}" >> $GITHUB_ENV | |
| else | |
| # Get the latest released version from GitHub releases | |
| LATEST_VERSION=$(curl -s https://api.github.com/repos/falkordb/text-to-cypher/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') | |
| echo "CYPHER_VERSION=$LATEST_VERSION" >> $GITHUB_ENV | |
| fi | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set tags | |
| run: | | |
| if ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}; then | |
| echo "TAGS=falkordb/falkordb-browser:latest,falkordb/falkordb-browser:${{ github.ref_name }}" >> $GITHUB_ENV | |
| else | |
| echo "TAGS=falkordb/falkordb-browser:edge" >> $GITHUB_ENV | |
| fi | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ env.TAGS }} | |
| build-args: | | |
| CYPHER_VERSION=${{ env.CYPHER_VERSION }} |