Refactor device rendering logic to display a message when no devices … #94
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: Home Assistant Add-on Builder | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Build add-on | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build frontend | |
| run: | | |
| cd frontend | |
| npm ci | |
| npm run build | |
| - name: Prepare build context | |
| run: | | |
| mkdir -p aquable/frontend | |
| cp -r frontend/dist aquable/frontend/ | |
| cp -r src aquable/ | |
| cp pyproject.toml aquable/ | |
| # cp aquable/README.stable.md aquable/README.md | |
| - name: Get version from tag | |
| id: version | |
| run: | | |
| if [[ $GITHUB_REF == refs/tags/v* ]]; then | |
| echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| echo "tag_type=release" >> $GITHUB_OUTPUT | |
| else | |
| echo "version=dev" >> $GITHUB_OUTPUT | |
| echo "tag_type=dev" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Login to GitHub Container Registry | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build add-on (release) | |
| if: steps.version.outputs.tag_type == 'release' | |
| uses: home-assistant/builder@master | |
| with: | |
| args: | | |
| --target aquable \ | |
| --docker-hub ghcr.io/${{ github.repository_owner }} \ | |
| --amd64 \ | |
| --version ${{ steps.version.outputs.version }} | |
| - name: Build add-on (dev) | |
| if: steps.version.outputs.tag_type == 'dev' | |
| uses: home-assistant/builder@master | |
| with: | |
| args: | | |
| --target aquable \ | |
| --docker-hub ghcr.io/${{ github.repository_owner }} \ | |
| --amd64 \ | |
| --test |