bump substreams to latest #673
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 docker image | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| branches: | |
| - "develop" | |
| - "feature/*" | |
| - "fix/*" | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| platform_suffix: amd64 | |
| runner: ubuntu-24.04 | |
| - platform: linux/arm64 | |
| platform_suffix: arm64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ["${{ matrix.runner }}"] | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract version | |
| id: extract-version | |
| run: | | |
| version="edge-${GITHUB_SHA::7}" | |
| if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| version=${GITHUB_REF#refs/tags/} | |
| fi | |
| echo "GO_PSEUDOHASH=$(go list -f '{{.Version}}' -m github.com/streamingfast/firehose-core@${{ github.sha }})" >> "$GITHUB_OUTPUT" | |
| echo "VERSION=${version}" >> "$GITHUB_OUTPUT" | |
| - name: Generate docker tags/labels from github build context | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=tag | |
| type=sha,prefix= | |
| type=sha,prefix=,suffix=-${{ matrix.platform_suffix }} | |
| type=raw,value=${{ steps.extract-version.outputs.GO_PSEUDOHASH }} | |
| type=raw,enable=${{ github.ref == 'refs/heads/develop' }},value=develop | |
| flavor: | | |
| latest=${{ startsWith(github.ref, 'refs/tags/') }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| provenance: false | |
| build-args: | | |
| VERSION=${{ steps.extract-version.outputs.VERSION }} | |
| push: | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| tags: ${{ steps.meta.outputs.tags }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Docker login | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract version | |
| id: extract-version | |
| run: | | |
| echo "GO_PSEUDOHASH=$(go list -f '{{.Version}}' -m github.com/streamingfast/firehose-core@${{ github.sha }})" >> "$GITHUB_OUTPUT" | |
| - name: Generate docker tags/labels from github build context | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=tag | |
| type=sha,prefix= | |
| type=raw,value=${{ steps.extract-version.outputs.GO_PSEUDOHASH }} | |
| type=raw,enable=${{ github.ref == 'refs/heads/develop' }},value=develop | |
| flavor: | | |
| latest=${{ startsWith(github.ref, 'refs/tags/') }} | |
| sep-tags: "," | |
| - name: Extract image | |
| id: image | |
| run: | | |
| echo "ID=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT" | |
| - name: Create and push manifest images | |
| uses: Noelware/[email protected] | |
| with: | |
| inputs: "${{ steps.meta.outputs.tags }}" | |
| images: "${{ steps.image.outputs.ID }}-amd64, ${{ steps.image.outputs.ID }}-arm64" | |
| push: true | |
| slack-notifications: | |
| needs: [push] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Extract Metadata Tags | |
| id: metadata | |
| run: echo "tags=${{ needs.push.outputs.tags }}" | sed 's/,/ /g' >> "$GITHUB_OUTPUT" | |
| - name: Slack notification | |
| env: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: Ilshidur/[email protected] | |
| with: | |
| args: | | |
| :done: *${{ github.repository }}* Success building docker image from ${{ github.ref_type }} _${{ github.ref_name }}_ (${{ github.actor }}) :sparkling_heart: ```${{ steps.metadata.outputs.tags }}``` |