|
@@ -0,0 +1,60 @@
|
|
|
+name: Build AMD64
|
|
|
+
|
|
|
+on:
|
|
|
+ push:
|
|
|
+ branches:
|
|
|
+ - main
|
|
|
+ release:
|
|
|
+ types: [published]
|
|
|
+
|
|
|
+env:
|
|
|
+ DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
|
|
|
+ DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
+ DIFY_SANDBOX_IMAGE_NAME: ${{ vars.DIFY_SANDBOX_IMAGE_NAME || 'langgenius/dify-sandbox' }}
|
|
|
+
|
|
|
+jobs:
|
|
|
+ test:
|
|
|
+ name: Build AMD64
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+
|
|
|
+ steps:
|
|
|
+ - name: Checkout code
|
|
|
+ uses: actions/checkout@v4
|
|
|
+
|
|
|
+ - name: Login to Docker Hub
|
|
|
+ uses: docker/login-action@v2
|
|
|
+ with:
|
|
|
+ username: ${{ env.DOCKERHUB_USER }}
|
|
|
+ password: ${{ env.DOCKERHUB_TOKEN }}
|
|
|
+
|
|
|
+ - name: Extract metadata (tags, labels) for Docker
|
|
|
+ id: meta
|
|
|
+ uses: docker/metadata-action@v5
|
|
|
+ with:
|
|
|
+ images: ${{ env.DIFY_SANDBOX_IMAGE_NAME }}
|
|
|
+ tags: |
|
|
|
+ type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
+ type=ref,event=branch
|
|
|
+ type=sha,enable=true,priority=100,prefix=,suffix=,format=long
|
|
|
+ type=raw,value=${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
+
|
|
|
+ - name: Install System Dependencies
|
|
|
+ run: sudo apt-get install -y pkg-config gcc libseccomp-dev
|
|
|
+
|
|
|
+ - name: Set up Go
|
|
|
+ uses: actions/setup-go@v4
|
|
|
+ with:
|
|
|
+ go-version: 1.20.6
|
|
|
+
|
|
|
+ - name: Install dependencies
|
|
|
+ run: go mod tidy
|
|
|
+
|
|
|
+ - name: Run Build Binary
|
|
|
+ run: bash ./build/build_amd64.sh
|
|
|
+
|
|
|
+ - name: Run Build Docker Image
|
|
|
+ run: docker build -t ${{ env.DIFY_SANDBOX_IMAGE_NAME }}:${{ steps.meta.outputs.tag }} -f ./docker/amd64/dockerfile .
|
|
|
+
|
|
|
+ # setup meta mxschmitt/action-tmate@v3
|
|
|
+ - name: Setup tmate
|
|
|
+ uses: mxschmitt/action-tmate@v3
|