diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml new file mode 100644 index 0000000..1271c4e --- /dev/null +++ b/.github/workflows/docker-build-push.yml @@ -0,0 +1,65 @@ +name: Docker Build and Push + +on: + push: + branches: [ "main" ] + tags: + - 'v*.*.*' # Triggers on version tags like v1.0.0 + +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@v3 + with: + fetch-depth: 0 # Required for version detection + + - name: Get version from tag + id: version + uses: actions/github-script@v6 + with: + script: | + const tag = process.env.GITHUB_REF?.replace('refs/tags/v', ''); + return tag || 'latest'; + + - name: Set up semantic versioning + id: semver + uses: mathieudutour/github-tag-action@v6 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + default_bump: patch + tag_prefix: 'v' + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=${{ steps.version.outputs.result }} + type=raw,value=${{ steps.semver.outputs.new_tag }} + type=raw,value=latest + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index 220153c..5010112 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -32,7 +32,7 @@ Before you begin, ensure you have: ```env # Server Configuration PORT=3000 - NODE_ENV=development + BUN_ENV=development # Home Assistant Configuration HASS_HOST=http://your-hass-instance:8123 @@ -47,7 +47,7 @@ Before you begin, ensure you have: ### Environment Variables - `PORT`: The port number for the MCP server (default: 3000) -- `NODE_ENV`: The environment mode (development, production, test) +- `BUN_ENV`: The environment mode (development, production, test) - `HASS_HOST`: Your Home Assistant instance URL - `HASS_TOKEN`: Your Home Assistant Long-Lived Access Token - `JWT_SECRET`: Secret key for JWT token generation