mirror of
https://github.com/luxfi/explore.git
synced 2026-07-27 05:54:15 +00:00
ci: simplify to single-arch amd64-only build on lux-build ARC runners
Drop arm64 + manifest jobs (cluster is amd64-only). All jobs now run on lux-build self-hosted runners — no GitHub-hosted runners needed. Build -> deploy in 2 jobs, no intermediate manifest step.
This commit is contained in:
@@ -20,8 +20,7 @@ env:
|
||||
IMAGE_NAME: luxfi/explore
|
||||
|
||||
jobs:
|
||||
# Build amd64 image on self-hosted DOKS lux-build runner
|
||||
build-amd64:
|
||||
build:
|
||||
runs-on: lux-build
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -53,11 +52,11 @@ jobs:
|
||||
flavor: |
|
||||
latest=false
|
||||
tags: |
|
||||
type=raw,value=latest,enable={{is_default_branch}},suffix=-amd64
|
||||
type=ref,event=branch,suffix=-amd64
|
||||
type=semver,pattern={{version}},suffix=-amd64
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=ref,event=branch
|
||||
type=semver,pattern={{version}}
|
||||
|
||||
- name: Build and push amd64 image
|
||||
- name: Build and push image
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
@@ -73,104 +72,10 @@ jobs:
|
||||
GIT_COMMIT_SHA=${{ env.SHORT_SHA }}
|
||||
GIT_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }}
|
||||
|
||||
# Build arm64 image natively on ARM runner
|
||||
build-arm64:
|
||||
runs-on: ubuntu-24.04-arm
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
outputs:
|
||||
image-digest: ${{ steps.build.outputs.digest }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Add SHORT_SHA
|
||||
run: echo "SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV
|
||||
|
||||
- name: Extract metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
flavor: |
|
||||
latest=false
|
||||
tags: |
|
||||
type=raw,value=latest,enable={{is_default_branch}},suffix=-arm64
|
||||
type=ref,event=branch,suffix=-arm64
|
||||
type=semver,pattern={{version}},suffix=-arm64
|
||||
|
||||
- name: Build and push arm64 image
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/arm64
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-cache:arm64
|
||||
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-cache:arm64,mode=max
|
||||
provenance: false
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
build-args: |
|
||||
GIT_COMMIT_SHA=${{ env.SHORT_SHA }}
|
||||
GIT_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }}
|
||||
|
||||
# Create multi-platform manifest
|
||||
create-manifest:
|
||||
if: github.event_name != 'pull_request'
|
||||
runs-on: lux-build
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
needs: [build-amd64, build-arm64]
|
||||
steps:
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Extract metadata for manifest
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
flavor: |
|
||||
latest=false
|
||||
tags: |
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=ref,event=branch
|
||||
type=semver,pattern={{version}}
|
||||
|
||||
- name: Create and push manifest
|
||||
run: |
|
||||
TAGS=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")
|
||||
AMD64_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.build-amd64.outputs.image-digest }}"
|
||||
ARM64_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.build-arm64.outputs.image-digest }}"
|
||||
docker buildx imagetools create $TAGS $AMD64_IMAGE $ARM64_IMAGE
|
||||
env:
|
||||
DOCKER_METADATA_OUTPUT_JSON: ${{ steps.meta.outputs.json }}
|
||||
|
||||
# Deploy to DOKS cluster
|
||||
deploy:
|
||||
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
||||
runs-on: lux-build
|
||||
needs: [create-manifest]
|
||||
needs: [build]
|
||||
steps:
|
||||
- name: Install doctl
|
||||
uses: digitalocean/action-doctl@v2
|
||||
|
||||
Reference in New Issue
Block a user