Skip to content

Commit

Permalink
build images
Browse files Browse the repository at this point in the history
  • Loading branch information
chliddle committed Dec 2, 2024
1 parent 8e4a385 commit cdf9a59
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and Push Images to Registry

on:
push:
branches:
- '**'
workflow_dispatch:

env:
REGISTRY: ghcr.io
REPOSITORY: ${{ github.repository }}

jobs:
build-and-push-image:
name: Build and Push Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- image_name: chain-indexer
package: chain
- image_name: governance-indexer
package: governance
- image_name: pos-indexer
package: pos
- image_name: rewards-indexer
package: rewards
- image_name: parameters-indexer
package: parameters
- image_name: transaction-indexer
package: transactions
- image_name: webserver-indexer
package: webserver

steps:
- name: Checkout repository
uses: actions/checkout@v3

- 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: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
build-args: |
PACKAGE=${{ matrix.package }}
push: true
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ matrix.image_name }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit cdf9a59

Please sign in to comment.