-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #378 from hearchco/as/ci/aws
ci: zip for aws
- Loading branch information
Showing
8 changed files
with
121 additions
and
163 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: ["v*.*.*"] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
issues: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
|
||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: arm64 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Generate go code from go:generate comments | ||
run: make install | ||
|
||
- name: Release | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
version: latest | ||
args: release --clean --config goreleaser/release.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Artifact Linux | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build_linux | ||
path: dist/*linux* |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1 @@ | ||
# Hearchco agent repository built using Go | ||
|
||
To self-host, you can use the official docker images: | ||
|
||
```yaml | ||
version: "3.9" | ||
services: | ||
traefik: | ||
image: "traefik:latest" | ||
command: | ||
- "--providers.docker=true" | ||
- "--providers.docker.exposedbydefault=false" | ||
- "--entryPoints.web.address=:80" | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock:ro" | ||
restart: unless-stopped | ||
frontend: | ||
image: ghcr.io/hearchco/frontend:latest | ||
environment: | ||
- PUBLIC_URI=https://search.example.org | ||
- API_URI=http://agent:3030 # server reachable, used for SSR | ||
- PUBLIC_API_URI=https://api.search.example.org # client reachable, used for CSR | ||
restart: unless-stopped | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.frontend.rule=Host(`search.example.org`)" | ||
- "traefik.http.routers.frontend.entrypoints=web" | ||
- "traefik.http.services.frontend.loadbalancer.server.port=3000" | ||
agent: | ||
image: ghcr.io/hearchco/agent:latest | ||
environment: | ||
- HEARCHCO_SERVER_FRONTENDURLS=http://localhost:5173,https://*search.example.org | ||
- HEARCHCO_SERVER_CACHE_TYPE=redis # set to "none" to disable caching, NOT RECOMMENDED | ||
- HEARCHCO_SERVER_CACHE_REDIS_HOST=redis | ||
# - HEARCHCO_SERVER_CACHE_REDIS_PASSWORD=redispassword # empty by default | ||
- HEARCHCO_SERVER_IMAGEPROXY_SECRETKEY=supersecretkey # used by image proxy for hashing image urls | ||
restart: unless-stopped | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.agent.rule=Host(`api.search.example.org`)" | ||
- "traefik.http.routers.agent.entrypoints=web" | ||
- "traefik.http.services.agent.loadbalancer.server.port=3030" | ||
redis: | ||
image: redis:latest | ||
volumes: | ||
- "redis-vol-0:/data" | ||
restart: unless-stopped | ||
volumes: | ||
redis-vol-0: | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
version: '3.9' | ||
services: | ||
# Traefik can be replaced with any reverse proxy, this is just an example | ||
traefik: | ||
image: docker.io/library/traefik:latest # NOTE: Don't use the latest tag in production | ||
command: | ||
- '--providers.docker=true' | ||
- '--providers.docker.exposedbydefault=false' | ||
- '--entryPoints.web.address=:80' | ||
ports: | ||
- '80:80' | ||
volumes: | ||
- '/var/run/docker.sock:/var/run/docker.sock:ro' | ||
restart: unless-stopped | ||
# SvelteKit frontend, used for server-side rendering and serving web browser clients | ||
frontend: | ||
image: ghcr.io/hearchco/frontend:latest # NOTE: Don't use the latest tag in production | ||
environment: | ||
- PUBLIC_URI=https://search.example.org # Public accessible URI of the frontend, used to generate opensearch.xml | ||
- API_URI=http://agent:3030 # Frontend reachable URI of the agent, used for fetching data when server-side rendering | ||
- PUBLIC_API_URI=https://api.search.example.org # Public accessible URI of the agent, used for fetching data from the browser (using JS) | ||
restart: unless-stopped | ||
labels: | ||
- 'traefik.enable=true' | ||
- 'traefik.http.routers.frontend.rule=Host(`search.example.org`)' | ||
- 'traefik.http.routers.frontend.entrypoints=web' | ||
- 'traefik.http.services.frontend.loadbalancer.server.port=3000' # This is the port defined in the Dockerfile for frontend | ||
# Go agent, used for scraping search engines and other data sources and serving a JSON REST API for frontend | ||
agent: | ||
image: ghcr.io/hearchco/agent:latest # NOTE: Don't use the latest tag in production | ||
environment: | ||
- HEARCHCO_SERVER_FRONTENDURLS=http://localhost:5173,https://*search.example.org # Comma separated list, with wildcard (*) support in URIs, used for CORS | ||
- HEARCHCO_SERVER_CACHE_TYPE=redis # Can be "none", "redis" or "dynamodb". Disabling the cache is discouraged. | ||
- HEARCHCO_SERVER_CACHE_REDIS_HOST=redis | ||
- HEARCHCO_SERVER_CACHE_REDIS_PASSWORD=redispassword | ||
# - HEARCHCO_SERVER_CACHE_DYNAMODB_REGION=eu-central-1 # Can be left empty or set to "global" for global tables | ||
# - HEARCHCO_SERVER_CACHE_DYNAMODB_TABLE=hearchco-cache | ||
- HEARCHCO_SERVER_IMAGEPROXY_SECRETKEY=super_secret_key_that_is_at_least_32_chars_long # Used by image proxy for hashing image URLs, set to something long and secure | ||
restart: unless-stopped | ||
labels: | ||
- 'traefik.enable=true' | ||
- 'traefik.http.routers.agent.rule=Host(`api.search.example.org`)' | ||
- 'traefik.http.routers.agent.entrypoints=web' | ||
- 'traefik.http.services.agent.loadbalancer.server.port=3030' # This is the port defined in the Dockerfile for agent | ||
redis: | ||
image: docker.io/library/redis:latest # NOTE: Don't use the latest tag in production | ||
command: | ||
- '--requirepass=redispassword' | ||
volumes: | ||
- 'redis-vol-0:/data:Z' | ||
restart: unless-stopped | ||
volumes: | ||
redis-vol-0: |
This file contains 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