diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..04d7b72 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: Build +on: + pull_request: + paths-ignore: + - '**.md' + push: + paths-ignore: + - '**.md' + workflow_dispatch: + inputs: + debug: + description: Enable debug + type: boolean + required: false + default: false +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: azuwis/nix-action@main + with: + key: zigbee2mqtt-networkmap-${{ hashFiles('flake.*') }} + debug: ${{ github.event_name == 'workflow_dispatch' && inputs.debug }} + credential: ${{ secrets.TTYD_CREDENTIAL }} + - uses: cachix/cachix-action@v12 + with: + name: azuwis + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + - name: Build + run: | + nix -L develop .# --profile ~/.local/state/nix/profiles/shell --command yarn build + test -e ./dist/zigbee2mqtt-networkmap.js + - uses: actions/upload-artifact@v4 + with: + name: zigbee2mqtt-networkmap + path: ./dist/zigbee2mqtt-networkmap.js + - uses: softprops/action-gh-release@v1 + if: ${{ startsWith(github.ref, 'refs/tags/') }} + with: + files: ./dist/zigbee2mqtt-networkmap.js + - uses: azuwis/nix-action@post