lightswitch 0.7.0

CPU profiler as a library for Linux suitable for on-demand and continuous profiling
name: build container image
on:
  pull_request:
  push:
      branches:
        - main

jobs:
  container:
    runs-on: ubuntu-22.04
    permissions:
      id-token: write
      contents: read
      packages: write

    steps:
    - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23
    - uses: DeterminateSystems/flakehub-cache-action@0975873945367f5239ebb5f49c133bf3543a08f6 # v2

    - name: Show nix version
      run: nix --version
    - name: Set up nix dev env
      run: nix develop --command echo 0
    - name: Build container image
      run: nix build .#container
    - name: Push container image on commits to main
      if: ${{ github.repository_owner == 'javierhonduco' && github.ref_name == 'main' }}
      run: |
        export CONTAINERS_REGISTRIES_CONF=/dev/null
        nix develop --ignore-environment --keep-env-var CONTAINERS_REGISTRIES_CONF --command skopeo copy --dest-creds="${{ github.repository_owner }}:${{ github.token }}" docker-archive:./result docker://ghcr.io/javierhonduco/lightswitch:main-${{ github.sha }}