Return empty if no folder #73
This file contains 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: CI/CD | |
on: | |
- push | |
- pull_request | |
- workflow_dispatch | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- run: npm ci | |
- run: npm run lint | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- run: npm ci | |
- run: npm test | |
env: | |
TZ: Europe/Paris | |
transpile: | |
name: Transpile | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- run: npm ci | |
- run: npm run build | |
build: | |
name: Build Docker images | |
runs-on: ubuntu-latest | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
needs: | |
- lint | |
- test | |
- transpile | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: home-assistant/builder@master | |
with: | |
args: | | |
--test \ | |
--all \ | |
--target . \ | |
--docker-hub ghcr.io/bokub | |
publish: | |
name: Build & publish Docker images | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- lint | |
- test | |
- transpile | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: bokub | |
password: ${{ secrets.CR_PAT }} | |
- uses: home-assistant/builder@master | |
with: | |
args: | | |
--all \ | |
--target . \ | |
--docker-hub ghcr.io/bokub |