|
|
@@ -20,7 +20,7 @@ env:
|
|
|
DOCKERHUB_REPO: ${{ secrets.DOCKERHUB_REPO != '' && secrets.DOCKERHUB_REPO || secrets.DOCKERHUB_USERNAME != '' && format('{0}/{1}', secrets.DOCKERHUB_USERNAME, 'aiproxy') || '' }}
|
|
|
GHCR_REPO: ghcr.io/${{ github.repository }}
|
|
|
ALIYUN_REGISTRY: ${{ secrets.ALIYUN_REGISTRY }}
|
|
|
- ALIYUN_REPO: ${{ secrets.ALIYUN_REPO != '' && secrets.ALIYUN_REPO || secrets.ALIYUN_USERNAME != '' && format('{0}/{1}/{2}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, 'aiproxy') || '' }}
|
|
|
+ ALIYUN_REPO: ${{ secrets.ALIYUN_REPO != '' && secrets.ALIYUN_REPO || (secrets.ALIYUN_REGISTRY != '' && secrets.ALIYUN_USERNAME != '') && format('{0}/{1}/{2}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, 'aiproxy') || '' }}
|
|
|
|
|
|
jobs:
|
|
|
release-web:
|
|
|
@@ -282,3 +282,88 @@ jobs:
|
|
|
- name: Inspect image
|
|
|
run: |
|
|
|
docker buildx imagetools inspect ${{ env.GHCR_REPO }}:${{ steps.meta.outputs.version }}
|
|
|
+ release-sealos-images:
|
|
|
+ name: Push Sealos Images
|
|
|
+ permissions:
|
|
|
+ packages: write
|
|
|
+ needs: release-docker-images
|
|
|
+ runs-on: ubuntu-24.04
|
|
|
+ if: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }}
|
|
|
+ steps:
|
|
|
+ - name: Checkout
|
|
|
+ uses: actions/checkout@v5
|
|
|
+ - name: install cache images tools
|
|
|
+ run: |
|
|
|
+ sudo bash ./.github/scripts/install.sh
|
|
|
+ - name: Set up QEMU
|
|
|
+ uses: docker/setup-qemu-action@v3
|
|
|
+ - uses: docker/setup-buildx-action@v3
|
|
|
+ - name: Prepare cluster image list
|
|
|
+ id: cluster_image_targets
|
|
|
+ run: |
|
|
|
+ set -euo pipefail
|
|
|
+ images=("${GHCR_REPO}-cluster")
|
|
|
+ if [ -n "${DOCKERHUB_REPO}" ]; then
|
|
|
+ images+=("${DOCKERHUB_REPO}-cluster")
|
|
|
+ fi
|
|
|
+ if [ -n "${ALIYUN_REPO}" ]; then
|
|
|
+ images+=("${ALIYUN_REPO}-cluster")
|
|
|
+ fi
|
|
|
+
|
|
|
+ {
|
|
|
+ echo "images<<EOF"
|
|
|
+ printf '%s\n' "${images[@]}"
|
|
|
+ echo "EOF"
|
|
|
+ csv=$(IFS=','; printf '%s' "${images[*]}")
|
|
|
+ echo "names=${csv}"
|
|
|
+ } >> "${GITHUB_OUTPUT}"
|
|
|
+ - name: Extract metadata (tags, labels) for Docker
|
|
|
+ id: meta
|
|
|
+ uses: docker/metadata-action@v5
|
|
|
+ with:
|
|
|
+ images: ${{ steps.cluster_image_targets.outputs.images }}
|
|
|
+ tags: |
|
|
|
+ type=ref,event=branch
|
|
|
+ type=ref,event=pr
|
|
|
+ type=ref,event=tag
|
|
|
+ type=semver,pattern={{version}}
|
|
|
+ type=semver,pattern={{major}}.{{minor}}
|
|
|
+ type=semver,pattern={{major}}
|
|
|
+ type=sha
|
|
|
+ - name: cache images
|
|
|
+ working-directory: core/deploy
|
|
|
+ run: |
|
|
|
+ sudo sealos login -u "${{ github.repository_owner }}" -p "${{ secrets.GITHUB_TOKEN }}" ghcr.io
|
|
|
+ sed -i "s#image: ghcr.io/labring/aiproxy:latest#image: ${{ env.GHCR_REPO }}:${{ steps.meta.outputs.version }}#g" charts/aiproxy/values.yaml
|
|
|
+ sudo sealos registry save --registry-dir=registry_amd64 --arch amd64 .
|
|
|
+ sudo sealos registry save --registry-dir=registry_arm64 --arch arm64 .
|
|
|
+ - name: Login to GitHub Container Registry
|
|
|
+ uses: docker/login-action@v3
|
|
|
+ with:
|
|
|
+ registry: ghcr.io
|
|
|
+ username: ${{ github.actor }}
|
|
|
+ password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
+
|
|
|
+ - name: Login to DockerHub
|
|
|
+ uses: docker/login-action@v3
|
|
|
+ if: ${{ env.DOCKERHUB_REPO }}
|
|
|
+ with:
|
|
|
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
+
|
|
|
+ - name: Login to Aliyun Registry
|
|
|
+ uses: docker/login-action@v3
|
|
|
+ if: ${{ env.ALIYUN_REGISTRY }}
|
|
|
+ with:
|
|
|
+ registry: ${{ env.ALIYUN_REGISTRY }}
|
|
|
+ username: ${{ secrets.ALIYUN_USERNAME }}
|
|
|
+ password: ${{ secrets.ALIYUN_PASSWORD }}
|
|
|
+ - name: Build images
|
|
|
+ uses: docker/build-push-action@v6
|
|
|
+ with:
|
|
|
+ context: ./core/deploy
|
|
|
+ file: ./core/deploy/Kubefile
|
|
|
+ labels: ${{ steps.meta.outputs.labels }}
|
|
|
+ platforms: linux/amd64,linux/arm64
|
|
|
+ push: ${{ github.event_name != 'pull_request' }}
|
|
|
+ tags: ${{ steps.meta.outputs.tags }}
|