Skip to content

Commit

Permalink
moar speed, simple.
Browse files Browse the repository at this point in the history
  • Loading branch information
kw1knode committed Oct 31, 2024
1 parent fa9a91b commit 3ebcafb
Showing 1 changed file with 11 additions and 28 deletions.
39 changes: 11 additions & 28 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,32 @@

name: Docker Build and Push

on:
push:
tags:
- 'v*.*.*'
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to build (e.g., v1.2.0)'
required: true
type: string

env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
IMAGE_NAME: evm-loadbalancer

jobs:
docker:
build:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
ref: ${{ github.event.inputs.tag || github.ref }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -54,8 +39,6 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILDKIT_INLINE_CACHE=1
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tag || github.ref_name }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest

0 comments on commit 3ebcafb

Please sign in to comment.