Migrate workflows to Blacksmith

This commit is contained in:
blacksmith-sh[bot] 2026-02-02 19:34:56 +00:00 committed by GitHub
parent 3dec5fbe36
commit 720b56544b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,7 +27,7 @@ env:
jobs: jobs:
test: test:
name: Test name: Test
runs-on: ubuntu-latest runs-on: blacksmith-4vcpu-ubuntu-2404
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -67,7 +67,7 @@ jobs:
build-branch: build-branch:
name: Build (Branch) name: Build (Branch)
needs: test needs: test
runs-on: ubuntu-latest runs-on: blacksmith-4vcpu-ubuntu-2404
if: github.event_name == 'push' && github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') if: github.event_name == 'push' && github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')
permissions: permissions:
contents: read contents: read
@ -76,8 +76,8 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Docker Buildx - name: Setup Blacksmith Builder
uses: docker/setup-buildx-action@v3 uses: useblacksmith/setup-docker-builder@v1
- name: Log in to GitHub Container Registry - name: Log in to GitHub Container Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
@ -95,7 +95,7 @@ jobs:
echo "name=$SAFE_BRANCH" >> $GITHUB_OUTPUT echo "name=$SAFE_BRANCH" >> $GITHUB_OUTPUT
- name: Build and push - name: Build and push
uses: docker/build-push-action@v6 uses: useblacksmith/build-push-action@v2
with: with:
context: . context: .
push: true push: true
@ -105,19 +105,11 @@ jobs:
tags: | tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.branch.outputs.name }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.branch.outputs.name }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${{ github.sha }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${{ github.sha }}
cache-from: |
type=gha,scope=build-amd64
type=gha,scope=release-amd64
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache-amd64
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
cache-to: |
type=gha,scope=build-amd64,mode=max
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache-amd64,mode=max
# Generate version info for release builds # Generate version info for release builds
version: version:
name: Version name: Version
runs-on: ubuntu-latest runs-on: blacksmith-4vcpu-ubuntu-2404
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
outputs: outputs:
version: ${{ steps.version.outputs.version }} version: ${{ steps.version.outputs.version }}
@ -162,13 +154,13 @@ jobs:
runner: ubuntu-latest runner: ubuntu-latest
- platform: linux/arm64 - platform: linux/arm64
arch: arm64 arch: arm64
runner: ubuntu-24.04-arm runner: blacksmith-4vcpu-ubuntu-2404-arm
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Docker Buildx - name: Setup Blacksmith Builder
uses: docker/setup-buildx-action@v3 uses: useblacksmith/setup-docker-builder@v1
- name: Log in to GitHub Container Registry - name: Log in to GitHub Container Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
@ -178,7 +170,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v6 uses: useblacksmith/build-push-action@v2
with: with:
context: . context: .
platforms: ${{ matrix.platform }} platforms: ${{ matrix.platform }}
@ -189,19 +181,12 @@ jobs:
BUILDKIT_INLINE_CACHE=1 BUILDKIT_INLINE_CACHE=1
tags: | tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.version.outputs.version }}-${{ matrix.arch }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.version.outputs.version }}-${{ matrix.arch }}
cache-from: |
type=gha,scope=release-${{ matrix.arch }}
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache-${{ matrix.arch }}
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
cache-to: |
type=gha,scope=release-${{ matrix.arch }},mode=max
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache-${{ matrix.arch }},mode=max
# Create multi-arch manifest after both builds complete # Create multi-arch manifest after both builds complete
manifest: manifest:
name: Create Manifest name: Create Manifest
needs: [version, build-release] needs: [version, build-release]
runs-on: ubuntu-latest runs-on: blacksmith-4vcpu-ubuntu-2404
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
permissions: permissions:
contents: read contents: read