name: Build and push a branch image to ghcr on: workflow_dispatch: push: branches: - dev - master repository_dispatch: types: [benchmark-trigger-image-build] permissions: contents: read jobs: branch-build-and-push: if: ${{ !github.event.client_payload.triggered }} runs-on: [self-hosted, linux, x64] permissions: contents: read packages: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ github.ref_name }} - uses: ./.github/actions/branch-build-and-push with: ghcr-password: ${{ secrets.GITHUB_TOKEN }} dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }} push-to-ghcr: true # Only push 'dev' and 'master' branch to Docker Hub push-to-dockerhub: ${{ github.ref_name == 'dev' || github.ref_name == 'master' }} # Enable `staging` feature for all branches except master (tags are excluded by ref_type check) staging-build: ${{ github.ref_type == 'branch' && github.ref_name != 'master' }} triggered-branch-build-and-push: if: ${{ github.event.client_payload.triggered }} runs-on: [self-hosted, linux, x64] permissions: contents: read packages: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ github.event.client_payload.version }} - uses: ./.github/actions/branch-build-and-push with: ghcr-password: ${{ secrets.GITHUB_TOKEN }} push-to-ghcr: true