Skip to content

Add CHANGELOG.md for HA Supervisor update notifications #25

Add CHANGELOG.md for HA Supervisor update notifications

Add CHANGELOG.md for HA Supervisor update notifications #25

Workflow file for this run

name: Publish Docker Image
on:
push:
branches: [main]
release:
types: [published]
jobs:
auto-release:
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Read version from config.yaml
id: get_version
run: |
VERSION=$(grep '^version:' espforge/config.yaml | sed 's/version: *"//;s/"//')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Create release if tag does not exist
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ steps.get_version.outputs.version }}"
TAG="v${VERSION}"
if git ls-remote --tags origin "$TAG" | grep -q "$TAG"; then
echo "Tag $TAG already exists, skipping release."
else
gh release create "$TAG" \
--title "$TAG" \
--generate-notes \
--target main
echo "Created release $TAG"
fi
build-and-push:
needs: [auto-release]
if: always()
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
- 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 GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./espforge
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VITE_BASE_PATH=./