Updater for HA addon version #648
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 Deploy Dockerimage | |
| on: | |
| push: | |
| branches: | |
| - stable | |
| - beta | |
| - dev | |
| tags: | |
| - "v*.*.*" | |
| pull_request: | |
| branches: | |
| - dev | |
| - beta | |
| types: [opened, labeled, synchronize, reopened, ready_for_review] | |
| jobs: | |
| docker: | |
| # if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }} | |
| runs-on: ubuntu-latest | |
| outputs: | |
| bco-tags: ${{ steps.bco-meta.outputs.tags }} | |
| steps: | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v4 | |
| - | |
| name: Docker bco meta | |
| id: bco-meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| # list of Docker images to use as base name for tags | |
| images: | | |
| openbaseorg/bco | |
| ghcr.io/openbase/bco | |
| # generate Docker tags based on the following events/attributes | |
| tags: | | |
| type=schedule | |
| type=raw,value=preview+{{commit_date 'YYYYMMDD-HHmmss' tz='UTC'}},enable=${{ contains(github.event.pull_request.labels.*.name, 'preview') }} | |
| type=raw,value={{branch}}+{{commit_date 'YYYYMMDD-HHmmss' tz='UTC'}},enable=startsWith(github.ref, 'refs/heads/') | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha | |
| - | |
| name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - | |
| name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - | |
| name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - | |
| name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - | |
| name: Build and push bco | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: docker/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }} | |
| tags: ${{ steps.bco-meta.outputs.tags }} | |
| labels: ${{ steps.bco-meta.outputs.labels }} | |
| env: | |
| TAG: 3.0-alpha | |
| - | |
| name: Docker bco device meta | |
| id: bco-device-meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| # list of Docker images to use as base name for tags | |
| images: | | |
| openbaseorg/bco-device-manager-openhab | |
| ghcr.io/openbase/bco-device-manager-openhab | |
| # generate Docker tags based on the following events/attributes | |
| tags: | | |
| type=schedule | |
| type=raw,value=preview,enable=${{ contains(github.event.pull_request.labels.*.name, 'preview') }} | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha | |
| - | |
| uses: benjlevesque/[email protected] | |
| id: short-sha | |
| - | |
| name: Build and push bco device manager | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./docker/device-manager/openhab | |
| build-args: | | |
| BCO_BASE_IMAGE_VERSION=sha-${{ steps.short-sha.outputs.sha }} | |
| file: ./docker/device-manager/openhab/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }} | |
| tags: ${{ steps.bco-device-meta.outputs.tags }} | |
| labels: ${{ steps.bco-device-meta.outputs.labels }} | |
| - | |
| name: Docker bco demo meta | |
| id: bco-demo-meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| # list of Docker images to use as base name for tags | |
| images: | | |
| openbaseorg/bco-demo | |
| ghcr.io/openbase/bco-demo | |
| # generate Docker tags based on the following events/attributes | |
| tags: | | |
| type=schedule | |
| type=raw,value=review,enable=${{ contains(github.event.pull_request.labels.*.name, 'preview') }} | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha | |
| - | |
| name: Build and push bco demo | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./docker/bco-demo | |
| build-args: | | |
| BCO_BASE_IMAGE_VERSION=sha-${{ steps.short-sha.outputs.sha }} | |
| file: ./docker/bco-demo/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }} | |
| tags: ${{ steps.bco-demo-meta.outputs.tags }} | |
| labels: ${{ steps.bco-demo-meta.outputs.labels }} | |
| update-addon-version: | |
| name: Update Home Assistant Add-on Version | |
| needs: docker | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: ./.github/workflows/update-addon-version.yaml | |
| with: | |
| version: ${{ github.ref_name }} | |
| addon: "bco-core" | |
| secrets: | |
| CI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| update-addon-version-dev: | |
| name: Update Home Assistant Add-on Version | |
| needs: docker | |
| if: startsWith(github.ref, 'refs/heads/dev') | |
| uses: ./.github/workflows/update-addon-version.yaml | |
| with: | |
| addon: "bco-core" | |
| tags: ${{ needs.docker.outputs.bco-tags }} | |
| track: dev | |
| secrets: | |
| CI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| update-addon-version-preview: | |
| name: Update Home Assistant Add-on Version | |
| needs: docker | |
| if: contains(github.event.pull_request.labels.*.name, 'preview') | |
| uses: ./.github/workflows/update-addon-version.yaml | |
| with: | |
| addon: "bco-core" | |
| tags: ${{ needs.docker.outputs.bco-tags }} | |
| track: preview | |
| secrets: | |
| CI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |