docs: explain self_update unreliability, recommend add-on update inst… #44
This file contains hidden or 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
| name: Build and publish add-on | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "meshcentral/**" | |
| - "CHANGELOG.md" | |
| release: | |
| types: [published] | |
| jobs: | |
| sync-changelog: | |
| name: Sync CHANGELOG to add-on folder | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Copy CHANGELOG.md to add-on subfolder | |
| run: cp CHANGELOG.md meshcentral/CHANGELOG.md | |
| - name: Commit if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git diff --quiet meshcentral/CHANGELOG.md || ( | |
| git add meshcentral/CHANGELOG.md && | |
| git commit -m "chore: sync CHANGELOG.md to add-on subfolder [skip ci]" | |
| ) | |
| - name: Push | |
| uses: ad-m/github-push-action@v0.8.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: main | |
| build: | |
| needs: sync-changelog | |
| name: Build ${{ matrix.arch }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| arch: [aarch64, amd64, armhf, armv7, i386] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Get version | |
| id: version | |
| run: | | |
| VERSION=$(jq -r '.version' meshcentral/config.yaml) | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| - name: Set image tags | |
| id: tags | |
| run: | | |
| IMAGE="ghcr.io/${{ github.repository_owner }}/meshcentral-addon-${{ matrix.arch }}" | |
| VERSION="${{ steps.version.outputs.version }}" | |
| # HA supervisor henter image:version — vi pusher både version og latest | |
| echo "tags=${IMAGE}:${VERSION},${IMAGE}:latest" >> $GITHUB_OUTPUT | |
| - name: Set platform | |
| id: platform | |
| run: | | |
| case "${{ matrix.arch }}" in | |
| amd64) echo "platform=linux/amd64" >> $GITHUB_OUTPUT ;; | |
| aarch64) echo "platform=linux/arm64" >> $GITHUB_OUTPUT ;; | |
| armhf) echo "platform=linux/arm/v6" >> $GITHUB_OUTPUT ;; | |
| armv7) echo "platform=linux/arm/v7" >> $GITHUB_OUTPUT ;; | |
| i386) echo "platform=linux/386" >> $GITHUB_OUTPUT ;; | |
| esac | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./meshcentral | |
| file: ./meshcentral/Dockerfile | |
| platforms: ${{ steps.platform.outputs.platform }} | |
| push: true | |
| tags: ${{ steps.tags.outputs.tags }} | |
| build-args: | | |
| BUILD_FROM=ghcr.io/home-assistant/${{ matrix.arch }}-base:latest |