Merge feat/performance-depth: pitch 01d performance depth #43
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: release | |
| # Builds and publishes the Beacon image to GitHub Container Registry. | |
| # | |
| # Triggers: | |
| # - push to main → ghcr.io/luuuc/beacon:main | |
| # ghcr.io/luuuc/beacon:edge | |
| # ghcr.io/luuuc/beacon:sha-<short> | |
| # - push of a v*.*.* git tag → ghcr.io/luuuc/beacon:vX.Y.Z | |
| # ghcr.io/luuuc/beacon:vX.Y | |
| # ghcr.io/luuuc/beacon:vX | |
| # ghcr.io/luuuc/beacon:latest | |
| # - workflow_dispatch → manual rebuild of main | |
| # | |
| # Images are multi-arch (linux/amd64 + linux/arm64) so both the Hetzner | |
| # AX42-U (amd64) and M-series dev laptops (arm64) can pull the same tag. | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*.*.*"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write # read for checkout, write for gh release create | |
| packages: write # required for GHCR push via GITHUB_TOKEN | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} # luuuc/beacon | |
| # Force docker/* actions (still on Node 20 runtimes as of Apr 2026) to | |
| # run under Node.js 24. Documented escape hatch from | |
| # https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/ | |
| # Becomes a no-op once Node 24 is the runner default in June 2026; | |
| # remove this line then (or once the docker org ships Node-24 majors | |
| # for all of login/metadata/setup-*/build-push). | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| jobs: | |
| build-and-push: | |
| name: Build + push multi-arch image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: arm64 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Compute image metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=branch | |
| type=sha,prefix=sha-,format=short | |
| type=edge,branch=main | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }} | |
| labels: | | |
| org.opencontainers.image.title=beacon | |
| org.opencontainers.image.description=The small observability accessory for self-hosted apps. | |
| org.opencontainers.image.licenses=OSaasy | |
| org.opencontainers.image.authors=Luc B. Perussault-Diallo | |
| - name: Resolve version string | |
| id: version | |
| run: | | |
| if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| echo "value=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "value=main-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| VERSION=${{ steps.version.outputs.value }} | |
| VCS_REF=${{ github.sha }} | |
| BUILD_DATE=${{ github.event.head_commit.timestamp }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Smoke-test the amd64 image | |
| # Pull the just-pushed sha-tagged image and run a few sanity | |
| # commands against it. arm64 can't run on the amd64 runner | |
| # without QEMU wrapping which is slow; amd64 is enough to | |
| # catch "the image won't start" or "default config is broken" | |
| # before anyone pulls :latest. | |
| run: | | |
| IMAGE="${REGISTRY}/${IMAGE_NAME}:sha-$(echo ${GITHUB_SHA} | cut -c1-7)" | |
| echo "smoke-testing $IMAGE" | |
| docker pull --platform linux/amd64 "$IMAGE" | |
| docker run --rm --platform linux/amd64 "$IMAGE" version | |
| docker run --rm --platform linux/amd64 "$IMAGE" help | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: gh release create "${{ github.ref_name }}" --generate-notes --latest | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |