Skip to content

Commit

Permalink
Merge pull request #48 from Gurubase/develop
Browse files Browse the repository at this point in the history
Add workflow file for selfhosted release
  • Loading branch information
fatihbaltaci authored Jan 21, 2025
2 parents aeacb0d + 042d6a8 commit 925d36f
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 8 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/backend-docker-image-dockerhub-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Backend Tag Build and Push Docker Image

on:
push:
tags:
- '*'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

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

- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/src/gurubase-backend/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Configure Dockerhub credentials
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: Build and push
env:
REPOSITORY_SELFHOSTED: ${{ secrets.GURUBASE_BE_SELFHOSTED_DOCKER_REPOSITORY }}
IMAGE_TAG: ${{ github.ref_name }}
uses: docker/build-push-action@v5
with:
context: src/gurubase-backend
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REPOSITORY_SELFHOSTED }}:${{ env.IMAGE_TAG }}
platforms: linux/amd64,linux/arm64
file: src/gurubase-backend/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Image Tag
env:
IMAGE_TAG: ${{ github.ref_name }}
run: |
echo "$IMAGE_TAG"
echo "Image Tag: $IMAGE_TAG" >> $GITHUB_STEP_SUMMARY
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Run this command to install Gurubase:

```bash
curl -fsSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/develop/gurubase.sh -o gurubase.sh
curl -fsSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/master/gurubase.sh -o gurubase.sh
bash gurubase.sh
```

Expand All @@ -27,7 +27,7 @@ The installer will:
You can upgrade to the latest version by running the following command:

```bash
curl -sSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/develop/gurubase.sh -o gurubase.sh
curl -sSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/master/gurubase.sh -o gurubase.sh
bash gurubase.sh upgrade
```

Expand All @@ -36,7 +36,7 @@ bash gurubase.sh upgrade
You can remove Gurubase by running the following command. This will remove the containers and networks but keep the data files.

```bash
curl -sSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/develop/gurubase.sh -o gurubase.sh
curl -sSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/master/gurubase.sh -o gurubase.sh
bash gurubase.sh rm
```

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">
<img src="https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/develop/imgs/gurubase-light-logo.svg#gh-light-mode-only" alt="Gurubase Light Logo" width="300px" />
<img src="https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/develop/imgs/gurubase-dark-logo.svg#gh-dark-mode-only" alt="Gurubase Dark Logo" width="300px" /><br/><br />
<img src="https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/master/imgs/gurubase-light-logo.svg#gh-light-mode-only" alt="Gurubase Light Logo" width="300px" />
<img src="https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/master/imgs/gurubase-dark-logo.svg#gh-dark-mode-only" alt="Gurubase Dark Logo" width="300px" /><br/><br />
</div>


Expand Down Expand Up @@ -56,7 +56,7 @@ Start asking questions directly on Gurubase, or [embed it on your website](https
If you prefer not to use [Gurubase.io](https://gurubase.io), you can install the entire system on your own servers.

```bash
curl -fsSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/develop/gurubase.sh -o gurubase.sh
curl -fsSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/master/gurubase.sh -o gurubase.sh
bash gurubase.sh
```

Expand Down
4 changes: 2 additions & 2 deletions gurubase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ upgrade_gurubase() {

# Download the latest docker-compose.yml
echo "📥 Downloading latest docker-compose.yml..."
if ! curl -sSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/develop/docker-compose.yml -o "$DOCKER_COMPOSE_FILE"; then
if ! curl -sSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/master/docker-compose.yml -o "$DOCKER_COMPOSE_FILE"; then
echo "❌ Failed to download new docker-compose.yml"
# Restore backup if it exists
if [ -f "${DOCKER_COMPOSE_FILE}.backup" ]; then
Expand Down Expand Up @@ -295,7 +295,7 @@ echo "🚀 Deploying Gurubase Self Hosted..."
# Start all services using docker compose
if [ ! -f "$DOCKER_COMPOSE_FILE" ]; then
echo "📥 Downloading docker-compose.yml..."
curl -sSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/develop/docker-compose.yml -o "$DOCKER_COMPOSE_FILE"
curl -sSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/master/docker-compose.yml -o "$DOCKER_COMPOSE_FILE"
fi

cd "$GURUBASE_DIR"
Expand Down

0 comments on commit 925d36f

Please sign in to comment.