synapsecns/sanguine

View on GitHub
.github/workflows/jaeger-ui.yml

Summary

Maintainability
Test Coverage
name: Jaeger UI (Pyroscope)
on:
  push:
    paths:
      - 'docker/jaeger-ui/**'
      - '.github/workflows/jaeger-ui.yml'
    branches:
      - master

jobs:
  build-jaeger-ui:
    runs-on: ubuntu-latest
    permissions:
      # always required
      packages: write
      # only required for private repos
      actions: read
      contents: read
    steps:
      - name: Git Checkout
        uses: actions/checkout@v4

      - name: Cache Docker images.
        uses: ScribeMD/docker-cache@0.3.6
        with:
          key: docker-release-jaeger

      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
        with:
          driver-opts: network=host

      -
        name: Login to GitHub Container Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      # we do this so we can use it in subsequent steps
      - name: Export latest tag name
        id: name-export
        run:
          echo "##[set-output name=TAG_NAME;]$(echo $LATEST_TAG_NAME)"
        env:
          LATEST_TAG_NAME: ghcr.io/synapsecns/jaeger-ui-pyroscope:${{ hashFiles('docker/jaeger-ui/**') }}

      -
        name: Build and push
        uses: docker/build-push-action@v3
        with:
          context: ./docker/jaeger-ui
          push: true
          file: ./docker/jaeger-ui/Dockerfile
          # TODO this needs to be versioned
          tags: ghcr.io/synapsecns/jaeger-ui-pyroscope:latest,${{ steps.name-export.outputs.TAG_NAME }}
          cache-from: type=registry,ref=ghcr.io/synapsecns/jaeger-ui-pyroscope:buildcache
          cache-to: type=registry,ref=ghcr.io/synapsecns/jaeger-ui-pyroscope:buildcache,mode=max