From 58de31d0eab0764f6b66e114ca9780061cde631d Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Thu, 6 Nov 2025 21:35:05 +1100 Subject: [PATCH] BE: prod workflow + docs Signed-off-by: jokob-sk --- .github/workflows/docker_prod.yml | 29 +++++++++++++---------------- README.md | 2 +- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker_prod.yml b/.github/workflows/docker_prod.yml index 93e2ae1c..548b05dc 100755 --- a/.github/workflows/docker_prod.yml +++ b/.github/workflows/docker_prod.yml @@ -6,7 +6,6 @@ # GitHub recommends pinning actions to a commit SHA. # To get a newer version, you will need to update the SHA. # You can also reference a tag or branch, but the action may change without warning. - name: Publish Docker image on: @@ -14,6 +13,7 @@ on: types: [published] tags: - '*.[1-9]+[0-9]?.[1-9]+*' + jobs: docker: runs-on: ubuntu-latest @@ -21,6 +21,7 @@ jobs: permissions: contents: read packages: write + steps: - name: Checkout uses: actions/checkout@v3 @@ -31,42 +32,39 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Set up dynamic build ARGs - id: getargs - run: echo "version=$(cat ./stable/VERSION)" >> $GITHUB_OUTPUT - + # --- Get release version from tag - name: Get release version id: get_version - run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}" + run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + # --- Write version to .VERSION file - name: Create .VERSION file - run: echo "${{ steps.get_version.outputs.version }}" >> .VERSION + run: echo "${{ steps.get_version.outputs.version }}" > .VERSION + # --- Generate Docker metadata and tags - name: Docker meta id: meta uses: docker/metadata-action@v4 with: - # list of Docker images to use as base name for tags images: | ghcr.io/jokob-sk/netalertx - jokobsk/netalertx - # generate Docker tags based on the following events/attributes + jokobsk/netalertx tags: | - type=semver,pattern={{version}},value=${{ inputs.version }} - type=semver,pattern={{major}}.{{minor}},value=${{ inputs.version }} - type=semver,pattern={{major}},value=${{ inputs.version }} + type=semver,pattern={{version}},value=${{ steps.get_version.outputs.version }} + type=semver,pattern={{major}}.{{minor}},value=${{ steps.get_version.outputs.version }} + type=semver,pattern={{major}},value=${{ steps.get_version.outputs.version }} type=ref,event=branch,suffix=-{{ sha }} type=ref,event=pr type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }} - - name: Log in to Github Container registry + - name: Log in to Github Container Registry (GHCR) uses: docker/login-action@v3 with: registry: ghcr.io username: jokob-sk password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to DockerHub + - name: Log in to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: @@ -81,6 +79,5 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - # # ⚠ disable cache if build is failing to download debian packages # cache-from: type=registry,ref=ghcr.io/jokob-sk/netalertx:buildcache # cache-to: type=registry,ref=ghcr.io/jokob-sk/netalertx:buildcache,mode=max diff --git a/README.md b/README.md index a1246bb0..d923ba1d 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # NetAlertX - Network, presence scanner and alert framework -Get visibility of what's going on on your WIFI/LAN network and enable presence detection of important devices. Schedule scans for devices, port changes and get alerts if unknown devices or changes are found. Write your own [Plugin](https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md#readme) with auto-generated UI and in-build notification system. Build out and easily maintain your network source of truth (NSoT). +Get visibility of what's going on on your WIFI/LAN network and enable presence detection of important devices. Schedule scans for devices, port changes and get alerts if unknown devices or changes are found. Write your own [Plugin](https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md#readme) with auto-generated UI and in-build notification system. Build out and easily maintain your network source of truth (NSoT) and device inventory. ## 📋 Table of Contents