|
| 1 | +# .github/workflows/release.yml |
| 2 | +name: Release AgentEx |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + commit-sha: |
| 7 | + description: "Commit SHA to release (defaults to latest commit on main)" |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + default: github.sha |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read # This is needed for checking out code |
| 14 | + packages: write # This is needed for pushing to GHCR |
| 15 | + |
| 16 | +env: |
| 17 | + AGENTEX_SERVER_IMAGE_NAME: agentex |
| 18 | + AGENTEX_AUTH_IMAGE_NAME: agentex-auth |
| 19 | + |
| 20 | +jobs: |
| 21 | + build-stable-image: |
| 22 | + name: "Push Stable Images to GHCR" |
| 23 | + runs-on: ubuntu-latest |
| 24 | + |
| 25 | + steps: |
| 26 | + # Checkout repository |
| 27 | + - name: Checkout |
| 28 | + uses: actions/checkout@v4 |
| 29 | + with: |
| 30 | + ref: ${{ inputs.commit-sha || 'main' }} |
| 31 | + |
| 32 | + # Set up Python and uv for documentation building |
| 33 | + - name: Set up Python |
| 34 | + uses: actions/setup-python@v5 |
| 35 | + with: |
| 36 | + python-version: "3.12" |
| 37 | + |
| 38 | + - name: Install uv |
| 39 | + uses: astral-sh/setup-uv@v4 |
| 40 | + with: |
| 41 | + version: "0.7.3" |
| 42 | + |
| 43 | + # Set up Docker Buildx |
| 44 | + - name: Set up Docker Buildx |
| 45 | + uses: docker/setup-buildx-action@v3 |
| 46 | + |
| 47 | + # Login to GitHub Container Registry |
| 48 | + - name: Login to GitHub Container Registry |
| 49 | + uses: docker/login-action@v3 |
| 50 | + with: |
| 51 | + registry: ghcr.io |
| 52 | + username: ${{ github.actor }} |
| 53 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + |
| 55 | + # Build documentation |
| 56 | + - name: Build documentation |
| 57 | + working-directory: ./agentex |
| 58 | + run: | |
| 59 | + # Install docs dependencies |
| 60 | + uv sync --group docs |
| 61 | + # Build documentation |
| 62 | + cd docs && uv run mkdocs build |
| 63 | +
|
| 64 | + # Build and push server image to GHCR |
| 65 | + - name: Build and push AgentEx server image to GHCR |
| 66 | + uses: docker/build-push-action@v5 |
| 67 | + with: |
| 68 | + context: . |
| 69 | + file: ./agentex/Dockerfile |
| 70 | + push: true |
| 71 | + build-args: | |
| 72 | + INCLUDE_DOCS=true |
| 73 | + tags: | |
| 74 | + ghcr.io/${{ github.repository }}/${{ env.AGENTEX_SERVER_IMAGE_NAME }}:${{ inputs.commit-sha }} |
| 75 | + cache-from: type=gha,scope=${{ env.AGENTEX_SERVER_IMAGE_NAME }}-release |
| 76 | + cache-to: type=gha,mode=max,scope=${{ env.AGENTEX_SERVER_IMAGE_NAME }}-release |
| 77 | + |
| 78 | + # Build and push auth image to GHCR |
| 79 | + - name: Build and push AgentEx auth image to GHCR |
| 80 | + uses: docker/build-push-action@v5 |
| 81 | + with: |
| 82 | + context: . |
| 83 | + file: ./agentex-auth/Dockerfile |
| 84 | + push: true |
| 85 | + tags: | |
| 86 | + ghcr.io/${{ github.repository }}/${{ env.AGENTEX_AUTH_IMAGE_NAME }}:${{ inputs.commit-sha }} |
| 87 | + ghcr.io/${{ github.repository }}/${{ env.AGENTEX_AUTH_IMAGE_NAME }} |
| 88 | + cache-from: type=gha,scope=${{ env.AGENTEX_AUTH_IMAGE_NAME }}-release |
| 89 | + cache-to: type=gha,mode=max,scope=${{ env.AGENTEX_AUTH_IMAGE_NAME }}-release |
| 90 | + |
| 91 | + # Summary |
| 92 | + - name: Release Summary |
| 93 | + run: | |
| 94 | + echo "✅ Release complete!" |
| 95 | + echo "📦 Server image: ghcr.io/${{ github.repository }}/${{ env.AGENTEX_SERVER_IMAGE_NAME }}:${{ inputs.commit-sha }}" |
| 96 | + echo "🔐 Auth image: ghcr.io/${{ github.repository }}/${{ env.AGENTEX_AUTH_IMAGE_NAME }}:${{ inputs.commit-sha }}" |
0 commit comments