diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 9a4b46f..036cedc 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -1,5 +1,4 @@ name: Build - on: push: branches: [ main ] @@ -7,15 +6,39 @@ on: jobs: build-and-push: - name: Build and Push + name: Build and Push Docker Image runs-on: build-htz-01 steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Build and push Docker image run: | docker build -t cr.jdbnet.co.uk/public/goencode:latest . - docker push cr.jdbnet.co.uk/public/goencode:latest \ No newline at end of file + docker push cr.jdbnet.co.uk/public/goencode:latest + + build-binary: + name: Build and Upload Binary + runs-on: build-htz-01 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Build + run: | + go mod tidy + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o goencode ./cmd/goencode + + - name: Upload to Cloudflare R2 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: auto + R2_ENDPOINT: ${{ secrets.R2_ENDPOINT_URL }} + run: | + aws s3 cp goencode s3://apps/goencode --endpoint-url "$R2_ENDPOINT" \ No newline at end of file diff --git a/README.md b/README.md index daebd3a..1ffebb7 100644 --- a/README.md +++ b/README.md @@ -37,27 +37,20 @@ services: ports: - "8080:8080" environment: - # Database Configuration - GOENCODE_DB_HOST=db - GOENCODE_DB_PORT=3306 - GOENCODE_DB_USER=goencode - GOENCODE_DB_PASS=goencode_password - GOENCODE_DB_NAME=goencode - - # Web Server Configuration - GOENCODE_SERVER_LISTEN=0.0.0.0 - GOENCODE_SERVER_PORT=8080 + - GOENCODE_ENCODER_TEMP=/tmp/goencode - TZ=Europe/London - # Web UI Authentication (Optional) - GOENCODE_AUTH_USER=admin - GOENCODE_AUTH_PASS=secret - # Notifications (Optional) - GOENCODE_WEBHOOK_URL=http://your-webhook-endpoint.com/webhook - - # Encoding - - GOENCODE_ENCODER_TEMP=/tmp/goencode volumes: - /path/to/your/media:/media depends_on: @@ -79,6 +72,14 @@ volumes: goencode_db_data: ``` +## Deployment with Binary + +We also build the binary for Linux AMD64 which you can download from [https://apps.jdbnet.co.uk/goencode](https://apps.jdbnet.co.uk/goencode) + +You'll need to make sure ```ffmpeg``` and ```gzip``` are available on your system + +You'll also need to create the config file at ```/etc/goencode/goencode.yaml```. You can copy and edit the example [here](goencode.yaml) + ## Configuration GoEncode can be configured via `goencode.yaml` or entirely via environment variables (ideal for Docker/Kubernetes). Environment variables take precedence over the YAML file. @@ -98,16 +99,4 @@ GoEncode can be configured via `goencode.yaml` or entirely via environment varia | `GOENCODE_AUTH_USER` | Username for the web UI | | | `GOENCODE_AUTH_PASS` | Password for the web UI | | | `GOENCODE_WEBHOOK_URL` | Webhook URL for job failure notifications | | -| `GOENCODE_ENCODER_TEMP`| Temp directory for processing jobs | `/tmp/goencode` | - -## Building Locally - -To build the Docker image locally and push it to your registry: - -```bash -# Build the image -docker build -t cr.jdbnet.co.uk/public/goencode:latest . - -# Push to your registry -docker push cr.jdbnet.co.uk/public/goencode:latest -``` \ No newline at end of file +| `GOENCODE_ENCODER_TEMP`| Temp directory for processing jobs | `/tmp/goencode` | \ No newline at end of file