Repository navigation
sigp/lighthouse@stable [4447bbc0-7f1b-40c3-9af9-671c400a2f0e] #336
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: Build lighthouse docker image | |
| run-name: "${{ inputs.repository }}@${{ inputs.ref }}${{ inputs.correlation_id && format(' [{0}]', inputs.correlation_id) || '' }}" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| repository: | |
| description: The source lighthouse repository to build from | |
| default: sigp/lighthouse | |
| type: string | |
| required: true | |
| ref: | |
| description: The branch, tag or SHA to checkout and build from | |
| default: stable | |
| type: string | |
| required: true | |
| docker_tag: | |
| description: Override target docker tag (defaults to the above source ref if left blank) | |
| type: string | |
| required: false | |
| build_args: | |
| description: Build arguments to pass to the Docker build | |
| default: "" | |
| type: string | |
| required: false | |
| correlation_id: | |
| description: Optional correlation ID passed through to the run name (used by integrations) | |
| type: string | |
| required: false | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| platforms: ${{ steps.setup.outputs.platforms }} | |
| target_tag: ${{ steps.tag.outputs.docker_tag }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Prepare Matrix | |
| id: setup | |
| uses: ./.github/actions/prepare | |
| with: | |
| client: 'lighthouse' | |
| repository: ${{ inputs.repository }} | |
| ref: ${{ inputs.ref }} | |
| - name: Generate target tag | |
| id: tag | |
| uses: ./.github/actions/docker-tag | |
| with: | |
| input: ${{ inputs.docker_tag || inputs.ref }} | |
| repository: ${{ inputs.repository }} | |
| upstream_repository: sigp/lighthouse | |
| docker_tag: ${{ inputs.docker_tag }} | |
| deploy: | |
| needs: | |
| - prepare | |
| runs-on: ${{ matrix.runner }} | |
| continue-on-error: true | |
| strategy: | |
| matrix: | |
| include: ${{fromJson(needs.prepare.outputs.platforms)}} | |
| outputs: | |
| git_commit_hash: ${{ steps.set_output.outputs.git_commit_hash }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/install-deps | |
| with: | |
| repository: ${{ inputs.repository }} | |
| - uses: ./.github/actions/deploy | |
| id: deploy | |
| with: | |
| source_repository: ${{ inputs.repository }} | |
| source_ref: ${{ inputs.ref }} | |
| target_tag: ${{ needs.prepare.outputs.target_tag }}-${{ matrix.slug }} | |
| target_repository: ethpandaops/lighthouse | |
| target_dockerfile: ./lighthouse/Dockerfile | |
| platform: ${{ matrix.platform }} | |
| build_args: ${{ inputs.build_args }} | |
| DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}" | |
| DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" | |
| MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}" | |
| GOPROXY: "${{ vars.GOPROXY }}" | |
| HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}" | |
| HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}" | |
| harbor_registry: ${{ vars.HARBOR_REGISTRY }} | |
| # This step captures the git commit hash from the deploy action for job output | |
| - name: Set job output | |
| id: set_output | |
| run: echo "git_commit_hash=${{ steps.deploy.outputs.git_commit_hash }}" >> $GITHUB_OUTPUT | |
| shell: bash | |
| manifest: | |
| needs: | |
| - prepare | |
| - deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/manifest | |
| with: | |
| source_repository: ${{ inputs.repository }} | |
| source_ref: ${{ inputs.ref }} | |
| target_tag: ${{ needs.prepare.outputs.target_tag }} | |
| target_repository: ethpandaops/lighthouse | |
| platforms: ${{ needs.prepare.outputs.platforms }} | |
| harbor_registry: ${{ vars.HARBOR_REGISTRY }} | |
| HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}" | |
| HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}" | |
| git_commit_hash: ${{ needs.deploy.outputs.git_commit_hash }} | |
| DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}" | |
| DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" | |
| notify: | |
| name: Discord Notification | |
| runs-on: ubuntu-latest | |
| needs: | |
| - prepare | |
| - deploy | |
| - manifest | |
| if: failure() | |
| steps: | |
| - name: Notify | |
| uses: nobrayner/discord-webhook@1766a33bf571acdcc0678f00da4fb83aad01ebc7 # v1 | |
| with: | |
| github-token: ${{ secrets.github_token }} | |
| discord-webhook: ${{ secrets.DISCORD_WEBHOOK }} |