Use maximise build space action #26
Workflow file for this run
This file contains 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 | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
build: | |
name: Containers | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- v1.23.1 | |
- v1.23.2 | |
- v1.23.3 | |
- v1.23.4-rc1 | |
net: | |
- name: mainnet | |
goflags: '' | |
- name: devnet | |
goflags: '-tags=debug' | |
platform: | |
- linux/amd64,linux/arm64 | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
android: true | |
dotnet: true | |
haskell: true | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
repository: filecoin-project/lotus | |
ref: ${{ matrix.version }} | |
path: lotus | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
platforms: ${{ matrix.platform }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata for Lotus ${{ matrix.version }} ${{ matrix.net.name }} | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
tags: | | |
type=raw,value=lotus-${{ matrix.version }}-${{ matrix.net.name }} | |
- name: Build Lotus ${{ matrix.version }} ${{ matrix.net.name }} | |
uses: docker/build-push-action@v4 | |
env: | |
REGISTRY_CACHE_REF: ghcr.io/${{ github.repository }}:cache | |
with: | |
context: lotus | |
cache-from: type=registry,ref=${{ env.REGISTRY_CACHE_REF }} | |
cache-to: type=registry,mode=max,ref=${{ env.REGISTRY_CACHE_REF }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: ${{ matrix.platform }} | |
build-args: | | |
GOFLAGS=${{ matrix.net.goflags }} |