Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and publish boost devnet containers via CI #1661

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/actions/container-builder/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build
description: Build tag and optionally push container images
inputs:
name:
required: true
type: string
target:
required: false
type: string
file:
required: false
type: string
context:
required: false
type: string
default: '.'
build-args:
required: false
type: string
push:
required: false
type: boolean
default: false
runs:
using: "composite"
steps:
- name: Extract metadata for ${{ inputs.name }}
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
flavor: latest=false
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=sha,prefix=${{ inputs.name }}-
- name: Build ${{ inputs.name }}
uses: docker/build-push-action@v4
with:
context: ${{ inputs.context }}
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ inputs.push }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ${{ inputs.file }}
target: ${{ inputs.target }}
build-args: ${{ inputs.build-args }}
80 changes: 80 additions & 0 deletions .github/workflows/container-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build

on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:

jobs:
build:
name: Containers
runs-on: ubuntu-latest
env:
LOTUS_TEST_IMAGE: 'filecoin/lotus-all-in-one:v1.23.2'
FFI_BUILD_FROM_SOURCE: '0'
DOCKER_BUILDKIT: '1'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Update Boost modules
run: make build/.update-modules
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build boost-dev
uses: ./.github/actions/container-builder
with:
name: boost-dev
file: docker/devnet/Dockerfile.source
target: boost-dev
push: ${{ github.event_name != 'pull_request' }}
build-args: |
LOTUS_TEST_IMAGE=${{ env.LOTUS_TEST_IMAGE }}
FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }}
- name: Build booster-http-dev
uses: ./.github/actions/container-builder
with:
name: booster-http-dev
file: docker/devnet/Dockerfile.source
target: booster-http-dev
push: ${{ github.event_name != 'pull_request' }}
build-args: |
LOTUS_TEST_IMAGE=${{ env.LOTUS_TEST_IMAGE }}
FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }}
- name: Build booster-bitswap-dev
uses: ./.github/actions/container-builder
with:
name: booster-bitswap-dev
file: docker/devnet/Dockerfile.source
target: booster-bitswap-dev
push: ${{ github.event_name != 'pull_request' }}
build-args: |
LOTUS_TEST_IMAGE=${{ env.LOTUS_TEST_IMAGE }}
FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }}
- name: Build lotus-dev
uses: ./.github/actions/container-builder
with:
name: lotus-dev
context: ./docker/devnet/lotus
push: ${{ github.event_name != 'pull_request' }}
build-args: |
LOTUS_TEST_IMAGE=${{ env.LOTUS_TEST_IMAGE }}
FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }}
- name: Build lotus-miner-dev
uses: ./.github/actions/container-builder
with:
name: lotus-miner-dev
context: ./docker/devnet/lotus-miner
push: ${{ github.event_name != 'pull_request' }}
build-args: |
LOTUS_TEST_IMAGE=${{ env.LOTUS_TEST_IMAGE }}
FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }}