Setup github actions for docker publishing
This commit is contained in:
1 parent
4ef67ca434
commit
6e165d65b6
3 files changed
+89
-7
No files matched your search
@@ -0,0 +1,57 @@
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
@@ -67,21 +67,48 @@ Self-hosted YouTube music streaming application built with Next.js.
|
||||
5. **Open your browser:**
|
||||
Navigate to [http://localhost:3000](http://localhost:3000)
|
||||
|
||||
## Docker Deployment
|
||||
## Quick Start with Docker (Recommended)
|
||||
|
||||
1. **Build and run with Docker Compose:**
|
||||
1. **Download the docker-compose.yml file:**
|
||||
```bash
|
||||
wget https://raw.githubusercontent.com/bitc0de/bitify/main/docker-compose.yml
|
||||
```
|
||||
Or on Windows PowerShell:
|
||||
```powershell
|
||||
Invoke-WebRequest -Uri https://raw.githubusercontent.com/bitc0de/bitify/main/docker-compose.yml -OutFile docker-compose.yml
|
||||
```
|
||||
|
||||
2. **Start the application:**
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
2. **Access the application:**
|
||||
3. **Access the application:**
|
||||
Navigate to [http://localhost:3000](http://localhost:3000)
|
||||
|
||||
3. **Stop the application:**
|
||||
4. **Stop the application:**
|
||||
```bash
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
The Docker image is automatically built and published to GitHub Container Registry on each release.
|
||||
|
||||
## Build from Source
|
||||
|
||||
If you prefer to build the Docker image yourself:
|
||||
|
||||
1. **Clone the repository:**
|
||||
```bash
|
||||
git clone https://github.com/bitc0de/bitify.git
|
||||
cd bitify
|
||||
```
|
||||
|
||||
2. **Build and run:**
|
||||
```bash
|
||||
docker build -t bitify .
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
1. **Add a song**: Paste a YouTube URL in the input field and click "Add"
|
||||
|
||||
+1
-3
@@ -2,9 +2,7 @@ version: '3.8'
|
||||
|
||||
services:
|
||||
bitify:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: ghcr.io/bitc0de/bitify:latest
|
||||
container_name: bitify
|
||||
ports:
|
||||
- "3000:3000"
|
||||
|
||||
Reference in new issue
Block a user