update
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 11s
Build Erigon Pulse Docker Image / docker_build (push) Failing after 1m20s

This commit is contained in:
G4MM4 2024-09-29 14:28:08 -05:00
parent d63df05114
commit d4b597fc08
2 changed files with 47 additions and 126 deletions

View File

@ -0,0 +1,47 @@
name: Build Erigon Pulse Docker Image
on:
push:
branches:
- main
pull_request:
branches:
- main
# Optionally, you can keep the tag trigger if you want to build on new tags
# push:
# tags:
# - 'v*'
jobs:
docker_build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: mirror/erigon-pulse
server_url: https://git.g4mm4.io
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: false # Set to true if you want to push to a registry
tags: erigon-pulse:latest
build-args: |
BUILD_DATE=${{ gitea.timestamp }}
VCS_REF=${{ gitea.sha }}
VERSION=${{ gitea.ref_name }}
provenance: false
- name: Display image info
run: |
docker image ls erigon-pulse:latest

View File

@ -1,126 +0,0 @@
name: Build and Release Erigon Pulse
on:
push:
tags:
- 'v*'
jobs:
compile_binaries:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Build for Linux AMD64
env:
CGO_CFLAGS: >-
-DMDBX_FORCE_ASSERTIONS=0 -O -D__BLST_PORTABLE__
-Wno-unknown-warning-option -Wno-enum-int-mismatch
-Wno-strict-prototypes
GO_FLAGS: -trimpath -tags nosqlite,noboltdb
run: |
GOOS=linux GOARCH=amd64 go build $GO_FLAGS \
-o _build/linux/erigon-amd64 ./cmd/erigon
- name: Build for Linux ARM64
env:
CGO_CFLAGS: >-
-DMDBX_FORCE_ASSERTIONS=0 -O -D__BLST_PORTABLE__
-Wno-unknown-warning-option -Wno-enum-int-mismatch
-Wno-strict-prototypes
GO_FLAGS: -trimpath -tags nosqlite,noboltdb
run: |
GOOS=linux GOARCH=arm64 go build $GO_FLAGS \
-o _build/linux/erigon-arm64 ./cmd/erigon
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: binaries
path: _build/
docker_build:
needs: compile_binaries
runs-on: gitea/runner-images:ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Gitea Container Registry
uses: docker/login-action@v2
with:
registry: git.g4mm4.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: git.g4mm4.io/mirror/erigon-pulse:${{ gitea.ref_name }}
build-args: |
BUILD_DATE=${{ gitea.timestamp }}
VCS_REF=${{ gitea.sha }}
VERSION=${{ gitea.ref_name }}
provenance: false
- name: Inspect manifest
run: |
docker manifest inspect git.g4mm4.io/mirror/erigon-pulse:${{ gitea.ref_name }}
create_release:
needs: docker_build
runs-on: ubuntu-22.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: binaries
path: _build/
- name: Create Release
run: |
TAG_NAME=${{ gitea.ref_name }}
curl -X POST "${{ gitea.api_url }}/repos/${{ gitea.repository.full_name }}/releases" \
-H "accept: application/json" \
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "'"$TAG_NAME"'",
"target_commitish": "${{ gitea.sha }}",
"name": "Release '"$TAG_NAME"'",
"body": "**Docker Image**\n- erigon-pulse multi-arch (amd64/arm64): `git.g4mm4.io/mirror/erigon-pulse:'"$TAG_NAME"'`\n\n## Release Notes\n_Release created by pipeline (pending release notes)._",
"draft": false,
"prerelease": false
}'
docker_tag_latest:
needs: create_release
runs-on: ubuntu-22.04
steps:
- name: Login to Gitea Container Registry
uses: docker/login-action@v2
with:
registry: git.g4mm4.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.ACCESS_TOKEN }}
- name: Tag latest
run: |
docker buildx imagetools create -t git.g4mm4.io/mirror/erigon-pulse:latest \
git.g4mm4.io/mirror/erigon-pulse:${{ gitea.ref_name }}