|
| 1 | +name: Build and Push Relayer Docker Image |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - 'relayer/**' |
| 7 | + - 'contracts/near/**' |
| 8 | + - '.github/workflows/relayer-docker.yml' |
| 9 | + release: |
| 10 | + types: [published] |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +env: |
| 14 | + REGISTRY: europe-west4-docker.pkg.dev |
| 15 | + PROJECT_ID: bridge-misc |
| 16 | + REPOSITORY: omni-bridge-docker-images |
| 17 | + |
| 18 | +jobs: |
| 19 | + build-and-push: |
| 20 | + runs-on: warp-ubuntu-latest-x64-2x |
| 21 | + permissions: |
| 22 | + contents: read |
| 23 | + id-token: write |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Checkout repository |
| 27 | + uses: actions/checkout@v5 |
| 28 | + |
| 29 | + - name: Authenticate to Google Cloud |
| 30 | + uses: google-github-actions/auth@v2 |
| 31 | + with: |
| 32 | + credentials_json: ${{ secrets.GCP_SA_KEY }} |
| 33 | + |
| 34 | + - name: Configure Docker to use gcloud as credential helper |
| 35 | + run: gcloud auth configure-docker ${{ env.REGISTRY }} |
| 36 | + |
| 37 | + - name: Extract metadata |
| 38 | + id: meta |
| 39 | + uses: docker/metadata-action@v5 |
| 40 | + with: |
| 41 | + images: ${{ env.REGISTRY }}/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/eth-relayer |
| 42 | + tags: | |
| 43 | + type=ref,event=branch |
| 44 | + type=ref,event=pr |
| 45 | + type=semver,pattern={{version}} |
| 46 | + type=semver,pattern={{major}}.{{minor}} |
| 47 | + type=semver,pattern={{major}} |
| 48 | + type=sha,prefix={{branch}} |
| 49 | + type=raw,value=latest,enable={{is_default_branch}} |
| 50 | +
|
| 51 | + - name: Build and push Docker image |
| 52 | + id: build |
| 53 | + uses: Warpbuilds/build-push-action@v6 |
| 54 | + with: |
| 55 | + context: . |
| 56 | + file: ./relayer/Dockerfile |
| 57 | + push: true |
| 58 | + tags: ${{ steps.meta.outputs.tags }} |
| 59 | + labels: ${{ steps.meta.outputs.labels }} |
| 60 | + platforms: linux/amd64 |
| 61 | + profile-name: "bridge-docker-builder" |
| 62 | + |
| 63 | + - name: Output image digest |
| 64 | + run: echo "Image pushed with digest ${{ steps.build.outputs.digest }}" |
0 commit comments