Skip to content

Commit

Permalink
Merge pull request #81 from memgraph/Add-action-for-publishing-mgconsole
Browse files Browse the repository at this point in the history
Add mgconsole build and release action
  • Loading branch information
antejavor authored Sep 17, 2024
2 parents e564229 + b9db078 commit ed9644c
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build and Release mgconsole Docker Image

on:
workflow_dispatch:
inputs:
version:
description: "Version of the Docker image to publish."
required: true
default: "0.0.1"
force_release:
description: "Force release even if the version already exists."
type: boolean
required: false
default: false

jobs:
build-and-push:
runs-on: ubuntu-latest
env:
DOCKER_ORGANIZATION_NAME: memgraph
DOCKER_REPOSITORY_NAME: mgconsole

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Check if specified version is already pushed
run: |
EXISTS=$(docker manifest inspect ${{ env.DOCKER_ORGANIZATION_NAME }}/${{ env.DOCKER_REPOSITORY_NAME }}:${{ github.event.inputs.version }} > /dev/null; echo $?)
echo $EXISTS
if [[ ${EXISTS} -eq 0 ]]; then
echo 'The specified version has been already released to DockerHub.'
if [[ ${{ github.event.inputs.force_release }} == 'true' ]]; then
echo 'Forcing the release!'
else
echo 'Stopping the release!'
exit 1
fi
else
echo 'All good, the specified version has not been released to DockerHub.'
fi
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
${{ env.DOCKER_ORGANIZATION_NAME }}/${{ env.DOCKER_REPOSITORY_NAME }}:${{ github.event.inputs.version }}
${{ env.DOCKER_ORGANIZATION_NAME }}/${{ env.DOCKER_REPOSITORY_NAME }}:latest
platforms: linux/amd64,linux/arm64


- name: Verify Docker image
run: |
docker run --rm $DOCKER_ORGANIZATION_NAME/$DOCKER_REPOSITORY_NAME:${{ github.event.inputs.version }} --version
File renamed without changes.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ database.

<img width="630" alt="mgconsole" src="https://github.com/memgraph/mgconsole/assets/4950251/b7ce1a0d-097c-4a2f-81b5-4049a307668b">


## Running mgconsole

For MacOs and Windows users, there is a prebuilt version of mgconsole available on [Memgraph download hub](https://memgraph.com/download), Linux users need to build native version.

There is also a docker version of the same container available on the [Docker Hub](https://hub.docker.com/repository/docker/memgraph/mgconsole/general).

You can start `mgconsole` locally by running the following command:

```
docker run -it memgraph/mgconsole:latest
```

## Building and installing

To build and install mgconsole from source you will need:
Expand Down

0 comments on commit ed9644c

Please sign in to comment.