release: v1.0.0-beta.3 #46
Workflow file for this run
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: Docker Publish | |
| on: | |
| push: | |
| tags: ['v*.*.*'] | |
| branches: ['master'] | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: 'Build only, do not push images to registry' | |
| type: boolean | |
| default: true | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-nfsen: | |
| name: Build nfsen-ng image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| if: ${{ github.event_name != 'workflow_dispatch' || !inputs.dry_run }} | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/mbolli/nfsen-ng | |
| labels: | | |
| org.opencontainers.image.title=nfsen-ng | |
| org.opencontainers.image.description=Modern NetFlow analyzer — PHP/OpenSwoole application server | |
| org.opencontainers.image.url=https://github.com/mbolli/nfsen-ng | |
| org.opencontainers.image.source=https://github.com/mbolli/nfsen-ng | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| # Pre-1.0: `latest` follows the newest *released* tag, betas included | |
| # (drop `&& !contains(github.ref_name, '-')` to re-gate it to stable only). | |
| # The reduced {{major}} / {{major}}.{{minor}} tags stay suppressed on | |
| # prereleases by metadata-action's default, so a beta can't claim :1 / :1.0. | |
| type=raw,value=latest,enable=${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
| type=raw,value=edge,enable=${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: deploy/Dockerfile | |
| push: ${{ github.event_name != 'workflow_dispatch' || !inputs.dry_run }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| annotations: ${{ steps.meta.outputs.annotations }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |