feat: migrate escrow manager to this repository #35
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 and upload Docker image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| REGISTRY: ghcr.io/${{ github.repository_owner }} | |
| jobs: | |
| release-please: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| concurrency: | |
| group: release-please-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| outputs: | |
| graph_tally_aggregator: ${{ steps.release-please.outputs['crates/bin/aggregator--tag_name'] }} | |
| graph_tally_escrow_manager: ${{ steps.release-please.outputs['crates/bin/escrow_manager--tag_name'] }} | |
| steps: | |
| - name: Release please | |
| id: release-please | |
| uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| builds-linux: | |
| runs-on: ubuntu-latest | |
| needs: release-please | |
| if: always() && (needs.release-please.result == 'success' || needs.release-please.result == 'skipped') | |
| strategy: | |
| matrix: | |
| target: [graph_tally_aggregator, graph_tally_escrow_manager] | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Extract version from tag | |
| id: extract_version | |
| run: | | |
| TAG_NAME="${{ needs.release-please.outputs[matrix.target] }}" | |
| if [[ "$TAG_NAME" =~ ^${{ matrix.target }}-(.*)$ ]]; then | |
| VERSION="${BASH_REMATCH[1]}" | |
| else | |
| VERSION="" | |
| fi | |
| echo $VERSION | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5 | |
| with: | |
| images: | | |
| ${{ env.REGISTRY }}/${{ matrix.target }} | |
| tags: | | |
| type=schedule | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}},value=${{steps.extract_version.outputs.version}} | |
| type=semver,pattern={{major}}.{{minor}},value=${{steps.extract_version.outputs.version}} | |
| type=semver,pattern={{major}}.{{minor}}.{{patch}},value=${{steps.extract_version.outputs.version}} | |
| type=semver,pattern={{major}},value=${{steps.extract_version.outputs.version}} | |
| type=semver,pattern=v{{version}},value=${{steps.extract_version.outputs.version}} | |
| type=semver,pattern=v{{major}}.{{minor}},value=${{steps.extract_version.outputs.version}} | |
| type=semver,pattern=v{{major}}.{{minor}}.{{patch}},value=${{steps.extract_version.outputs.version}} | |
| type=semver,pattern=v{{major}},value=${{steps.extract_version.outputs.version}} | |
| type=sha | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@3227f5311cb93ffd14d13e65d8cc400d30f4dd8a # v4 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 | |
| with: | |
| context: ./ | |
| push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| file: docker/Dockerfile.${{ matrix.target }} |