참고소스 수정본
This commit is contained in:
81
참고/firecrawl-main/.github/workflows/deploy-image.yml
vendored
Normal file
81
참고/firecrawl-main/.github/workflows/deploy-image.yml
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
name: Deploy Images to GHCR
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- apps/api/**
|
||||
- .github/workflows/deploy-image.yml
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.runner }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- platform: linux/amd64
|
||||
runner: blacksmith-4vcpu-ubuntu-2404
|
||||
- platform: linux/arm64
|
||||
runner: blacksmith-4vcpu-ubuntu-2404-arm
|
||||
defaults:
|
||||
run:
|
||||
working-directory: './apps/api'
|
||||
steps:
|
||||
- name: 'Checkout GitHub Action'
|
||||
uses: actions/checkout@main
|
||||
|
||||
- name: Setup Blacksmith Builder
|
||||
uses: useblacksmith/setup-docker-builder@ef12d5b165b596e3aa44ea8198d8fde563eab402 # v1
|
||||
|
||||
- name: 'Login to GitHub Container Registry'
|
||||
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # 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: useblacksmith/build-push-action@30c71162f16ea2c27c3e21523255d209b8b538c1 # v2
|
||||
with:
|
||||
context: ./apps/api
|
||||
push: true
|
||||
tags: ghcr.io/${{ env.REPO_OWNER }}/firecrawl:${{ env.PLATFORM_SUFFIX }}
|
||||
platforms: ${{ matrix.platform }}
|
||||
provenance: false
|
||||
|
||||
manifest:
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||
needs: build
|
||||
steps:
|
||||
- name: 'Login to GitHub Container Registry'
|
||||
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # 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
|
||||
Reference in New Issue
Block a user