Skip to content

[devops] update docker-compose (#529) #73

[devops] update docker-compose (#529)

[devops] update docker-compose (#529) #73

Workflow file for this run

permissions:
packages: write
name: build_image
on:
push:
tags: [ "v*.*.*" ]
env:
REGISTRY: ghcr.io
COORDINATOR_IMAGE_NAME: machinefi/coordinator
PROVER_IMAGE_NAME: machinefi/prover
SEQUENCER_IMAGE_NAME: machinefi/sequencer
jobs:
build_prover_image:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup Docker and Colima
if: startsWith(matrix.os, 'macos-latest') == true
run: |
brew install docker colima
colima start
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta-prover
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/${{ env.PROVER_IMAGE_NAME }}
- name: Build and push Docker image prover
id: build-and-push-prover
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./prover.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-prover.outputs.tags }}
labels: ${{ steps.meta-prover.outputs.labels }}
build_sequencer_image:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup Docker and Colima
if: startsWith(matrix.os, 'macos-latest') == true
run: |
brew install docker colima
colima start
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta-sequencer
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/${{ env.SEQUENCER_IMAGE_NAME }}
- name: Build and push Docker image sequencer
id: build-and-push-sequencer
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./sequencer.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-sequencer.outputs.tags }}
labels: ${{ steps.meta-sequencer.outputs.labels }}
build_coordinator_image:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup Docker and Colima
if: startsWith(matrix.os, 'macos-latest') == true
run: |
brew install docker colima
colima start
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta-coordinator
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/${{ env.COORDINATOR_IMAGE_NAME }}
- name: Build and push Docker image coordinator
id: build-and-push-coordinator
uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./coordinator.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-coordinator.outputs.tags }}
labels: ${{ steps.meta-coordinator.outputs.labels }}