Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(ci): use arm64 workers to build arm64 images quickly

Gergő Móricze25110b9b4e2
diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml
index d52ea864b..ded57eded 100644
--- a/.github/workflows/deploy-image.yml
+++ b/.github/workflows/deploy-image.yml
@@ -1,51 +1,82 @@
name: Deploy Images to GHCR
-env:
- DOTNET_VERSION: '6.0.x'
-
on:
push:
branches:
- main
paths:
- apps/api/**
+ - .github/workflows/deploy-image.yml
workflow_dispatch:
jobs:
- push-app-image:
- runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: './apps/api'
- steps:
- - name: 'Checkout GitHub Action'
- uses: actions/checkout@main
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v3
-
- - name: 'Set up Docker Buildx'
- uses: docker/setup-buildx-action@v3
-
- - name: 'Login to GitHub Container Registry'
- uses: docker/login-action@v3
- with:
- registry: ghcr.io
- username: ${{github.actor}}
- password: ${{secrets.GITHUB_TOKEN}}
-
- - name: Lowercase Repo Owner
- run: |
- echo "REPO_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
- env:
- GITHUB_REPOSITORY_OWNER: '${{ github.repository_owner }}'
-
- - name: 'Build and Push Image'
- uses: docker/build-push-action@v6
- with:
- context: ./apps/api
- push: true
- tags: ghcr.io/${{ env.REPO_OWNER }}/firecrawl:latest
- platforms: linux/amd64,linux/arm64
- cache-from: type=registry,ref=ghcr.io/${{ env.REPO_OWNER }}/firecrawl:buildcache
- cache-to: type=registry,ref=ghcr.io/${{ env.REPO_OWNER }}/firecrawl:buildcache,mode=max
\ No newline at end of file
+ build:
+ runs-on: ${{ matrix.runner }}
+ strategy:
+ matrix:
+ include:
+ - platform: linux/amd64
+ runner: ubuntu-latest
+ - platform: linux/arm64
+ runner: ubuntu-24.04-arm
+ defaults:
+ run:
+ working-directory: './apps/api'
+ steps:
+ - name: 'Checkout GitHub Action'
+ uses: actions/checkout@main
+
+ - name: 'Set up Docker Buildx'
+ uses: docker/setup-buildx-action@v3
+
+ - name: 'Login to GitHub Container Registry'
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{github.actor}}
+ password: ${{secrets.GITHUB_TOKEN}}
+
+ - name: Lowercase Repo Owner
+ run: |
+ echo "REPO_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
+ env:
+ GITHUB_REPOSITORY_OWNER: '${{ github.repository_owner }}'
+
+ - name: Extract platform suffix
+ run: |
+ platform=${{ matrix.platform }}
+ echo "PLATFORM_SUFFIX=${platform//\//-}" >> $GITHUB_ENV
+
+ - name: 'Build and Push Image'
+ uses: docker/build-push-action@v6
+ with:
+ context: ./apps/api
+ push: true
+ tags: ghcr.io/${{ env.REPO_OWNER }}/firecrawl:${{ env.PLATFORM_SUFFIX }}
+ platforms: ${{ matrix.platform }}
+ cache-from: type=registry,ref=ghcr.io/${{ env.REPO_OWNER }}/firecrawl:buildcache-${{ env.PLATFORM_SUFFIX }}
+ cache-to: type=registry,ref=ghcr.io/${{ env.REPO_OWNER }}/firecrawl:buildcache-${{ env.PLATFORM_SUFFIX }},mode=max
+
+ manifest:
+ runs-on: ubuntu-latest
+ needs: build
+ steps:
+ - name: 'Login to GitHub Container Registry'
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{github.actor}}
+ password: ${{secrets.GITHUB_TOKEN}}
+
+ - name: Lowercase Repo Owner
+ run: |
+ echo "REPO_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
+ env:
+ GITHUB_REPOSITORY_OWNER: '${{ github.repository_owner }}'
+
+ - name: 'Create and Push Multi-Arch Manifest'
+ run: |
+ docker manifest create ghcr.io/${{ env.REPO_OWNER }}/firecrawl:latest \
+ ghcr.io/${{ env.REPO_OWNER }}/firecrawl:linux-amd64 \
+ ghcr.io/${{ env.REPO_OWNER }}/firecrawl:linux-arm64
+ docker manifest push ghcr.io/${{ env.REPO_OWNER }}/firecrawl:latest
diff --git a/.github/workflows/deploy-playwright.yml b/.github/workflows/deploy-playwright.yml
index 2f16b79c1..de910a553 100644
--- a/.github/workflows/deploy-playwright.yml
+++ b/.github/workflows/deploy-playwright.yml
@@ -1,43 +1,82 @@
name: Deploy Playwright to GHCR
-env:
- DOTNET_VERSION: '6.0.x'
-
on:
push:
branches:
- main
paths:
- apps/playwright-service-ts/**
+ - .github/workflows/deploy-playwright.yml
workflow_dispatch:
jobs:
- push-app-image:
- runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: './apps/playwright-service-ts'
- steps:
- - name: 'Checkout GitHub Action'
- uses: actions/checkout@main
-
- - name: 'Login to GitHub Container Registry'
- uses: docker/login-action@v3
- with:
- registry: ghcr.io
- username: ${{github.actor}}
- password: ${{secrets.GITHUB_TOKEN}}
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v3
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
-
- - name: 'Build Inventory Image'
- run: |
- REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
- docker buildx build . \
- --platform linux/amd64,linux/arm64 \
- --tag ghcr.io/${REPO_OWNER}/playwright-service:latest \
- --push
\ No newline at end of file
+ build:
+ runs-on: ${{ matrix.runner }}
+ strategy:
+ matrix:
+ include:
+ - platform: linux/amd64
+ runner: ubuntu-latest
+ - platform: linux/arm64
+ runner: ubuntu-24.04-arm
+ defaults:
+ run:
+ working-directory: './apps/playwright-service-ts'
+ steps:
+ - name: 'Checkout GitHub Action'
+ uses: actions/checkout@main
+
+ - name: 'Set up Docker Buildx'
+ uses: docker/setup-buildx-action@v3
+
+ - name: 'Login to GitHub Container Registry'
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{github.actor}}
+ password: ${{secrets.GITHUB_TOKEN}}
+
+ - name: Lowercase Repo Owner
+ run: |
+ echo "REPO_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
+ env:
+ GITHUB_REPOSITORY_OWNER: '${{ github.repository_owner }}'
+
+ - name: Extract platform suffix
+ run: |
+ platform=${{ matrix.platform }}
+ echo "PLATFORM_SUFFIX=${platform//\//-}" >> $GITHUB_ENV
+
+ - name: 'Build and Push Image'
+ uses: docker/build-push-action@v6
+ with:
+ context: ./apps/playwright-service-ts
+ push: true
+ tags: ghcr.io/${{ env.REPO_OWNER }}/playwright-service:${{ env.PLATFORM_SUFFIX }}
+ platforms: ${{ matrix.platform }}
+ cache-from: type=registry,ref=ghcr.io/${{ env.REPO_OWNER }}/playwright-service:buildcache-${{ env.PLATFORM_SUFFIX }}
+ cache-to: type=registry,ref=ghcr.io/${{ env.REPO_OWNER }}/playwright-service:buildcache-${{ env.PLATFORM_SUFFIX }},mode=max
+
+ manifest:
+ runs-on: ubuntu-latest
+ needs: build
+ steps:
+ - name: 'Login to GitHub Container Registry'
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{github.actor}}
+ password: ${{secrets.GITHUB_TOKEN}}
+
+ - name: Lowercase Repo Owner
+ run: |
+ echo "REPO_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
+ env:
+ GITHUB_REPOSITORY_OWNER: '${{ github.repository_owner }}'
+
+ - name: 'Create and Push Multi-Arch Manifest'
+ run: |
+ docker manifest create ghcr.io/${{ env.REPO_OWNER }}/playwright-service:latest \
+ ghcr.io/${{ env.REPO_OWNER }}/playwright-service:linux-amd64 \
+ ghcr.io/${{ env.REPO_OWNER }}/playwright-service:linux-arm64
+ docker manifest push ghcr.io/${{ env.REPO_OWNER }}/playwright-service:latest