-
Notifications
You must be signed in to change notification settings - Fork 44.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
1,000 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
version: 2 | ||
updates: | ||
# autogpt_libs (Poetry project) | ||
- package-ecosystem: "pip" | ||
directory: "autogpt_platform/autogpt_libs" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 10 | ||
target-branch: "dev" | ||
groups: | ||
production-dependencies: | ||
dependency-type: "production" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
development-dependencies: | ||
dependency-type: "development" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
|
||
# backend (Poetry project) | ||
- package-ecosystem: "pip" | ||
directory: "autogpt_platform/backend" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 10 | ||
target-branch: "dev" | ||
groups: | ||
production-dependencies: | ||
dependency-type: "production" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
development-dependencies: | ||
dependency-type: "development" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
|
||
|
||
# frontend (Next.js project) | ||
- package-ecosystem: "npm" | ||
directory: "autogpt_platform/frontend" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 10 | ||
target-branch: "dev" | ||
groups: | ||
production-dependencies: | ||
dependency-type: "production" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
development-dependencies: | ||
dependency-type: "development" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
|
||
|
||
# infra (Terraform) | ||
- package-ecosystem: "terraform" | ||
directory: "autogpt_platform/infra" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 5 | ||
target-branch: "dev" | ||
groups: | ||
production-dependencies: | ||
dependency-type: "production" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
development-dependencies: | ||
dependency-type: "development" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
|
||
|
||
# market (Poetry project) | ||
- package-ecosystem: "pip" | ||
directory: "autogpt_platform/market" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 10 | ||
target-branch: "dev" | ||
groups: | ||
production-dependencies: | ||
dependency-type: "production" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
development-dependencies: | ||
dependency-type: "development" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
|
||
|
||
# GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 5 | ||
target-branch: "dev" | ||
groups: | ||
production-dependencies: | ||
dependency-type: "production" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
development-dependencies: | ||
dependency-type: "development" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
|
||
|
||
# Docker | ||
- package-ecosystem: "docker" | ||
directory: "autogpt_platform/" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 5 | ||
target-branch: "dev" | ||
groups: | ||
production-dependencies: | ||
dependency-type: "production" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
development-dependencies: | ||
dependency-type: "development" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
|
||
|
||
# Submodules | ||
- package-ecosystem: "gitsubmodule" | ||
directory: "autogpt_platform/supabase" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 1 | ||
target-branch: "dev" | ||
groups: | ||
production-dependencies: | ||
dependency-type: "production" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
development-dependencies: | ||
dependency-type: "development" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
|
||
|
||
# Docs | ||
- package-ecosystem: 'pip' | ||
directory: "docs/" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 1 | ||
target-branch: "dev" | ||
groups: | ||
production-dependencies: | ||
dependency-type: "production" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
development-dependencies: | ||
dependency-type: "development" | ||
update-types: | ||
- "minor" | ||
- "patch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
name: AutoGPT Platform - Build, Push, and Deploy Dev Environment | ||
|
||
on: | ||
push: | ||
branches: [ dev ] | ||
paths: | ||
- 'autogpt_platform/backend/**' | ||
- 'autogpt_platform/frontend/**' | ||
- 'autogpt_platform/market/**' | ||
|
||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
|
||
env: | ||
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | ||
GKE_CLUSTER: dev-gke-cluster | ||
GKE_ZONE: us-central1-a | ||
NAMESPACE: dev-agpt | ||
|
||
jobs: | ||
build-push-deploy: | ||
name: Build, Push, and Deploy | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- id: 'auth' | ||
uses: 'google-github-actions/auth@v1' | ||
with: | ||
workload_identity_provider: 'projects/638488734936/locations/global/workloadIdentityPools/dev-pool/providers/github' | ||
service_account: '[email protected]' | ||
token_format: 'access_token' | ||
create_credentials_file: true | ||
|
||
- name: 'Set up Cloud SDK' | ||
uses: 'google-github-actions/setup-gcloud@v1' | ||
|
||
- name: 'Configure Docker' | ||
run: | | ||
gcloud auth configure-docker us-east1-docker.pkg.dev | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Check for changes | ||
id: check_changes | ||
run: | | ||
git fetch origin dev | ||
BACKEND_CHANGED=$(git diff --name-only origin/dev HEAD | grep "^autogpt_platform/backend/" && echo "true" || echo "false") | ||
FRONTEND_CHANGED=$(git diff --name-only origin/dev HEAD | grep "^autogpt_platform/frontend/" && echo "true" || echo "false") | ||
MARKET_CHANGED=$(git diff --name-only origin/dev HEAD | grep "^autogpt_platform/market/" && echo "true" || echo "false") | ||
echo "backend_changed=$BACKEND_CHANGED" >> $GITHUB_OUTPUT | ||
echo "frontend_changed=$FRONTEND_CHANGED" >> $GITHUB_OUTPUT | ||
echo "market_changed=$MARKET_CHANGED" >> $GITHUB_OUTPUT | ||
- name: Get GKE credentials | ||
uses: 'google-github-actions/get-gke-credentials@v1' | ||
with: | ||
cluster_name: ${{ env.GKE_CLUSTER }} | ||
location: ${{ env.GKE_ZONE }} | ||
|
||
- name: Build and Push Backend | ||
if: steps.check_changes.outputs.backend_changed == 'true' | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./autogpt_platform/backend/Dockerfile | ||
push: true | ||
tags: us-east1-docker.pkg.dev/agpt-dev/agpt-backend-dev/agpt-backend-dev:${{ github.sha }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | ||
|
||
- name: Build and Push Frontend | ||
if: steps.check_changes.outputs.frontend_changed == 'true' | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./autogpt_platform/frontend/Dockerfile | ||
push: true | ||
tags: us-east1-docker.pkg.dev/agpt-dev/agpt-frontend-dev/agpt-frontend-dev:${{ github.sha }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | ||
|
||
- name: Build and Push Market | ||
if: steps.check_changes.outputs.market_changed == 'true' | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./autogpt_platform/market/Dockerfile | ||
push: true | ||
tags: us-east1-docker.pkg.dev/agpt-dev/agpt-market-dev/agpt-market-dev:${{ github.sha }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | ||
|
||
- name: Move cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||
- name: Set up Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.4.0 | ||
|
||
- name: Deploy Backend | ||
if: steps.check_changes.outputs.backend_changed == 'true' | ||
run: | | ||
helm upgrade autogpt-server ./autogpt-server \ | ||
--namespace ${{ env.NAMESPACE }} \ | ||
-f autogpt-server/values.yaml \ | ||
-f autogpt-server/values.dev.yaml \ | ||
--set image.tag=${{ github.sha }} | ||
- name: Deploy Websocket | ||
if: steps.check_changes.outputs.backend_changed == 'true' | ||
run: | | ||
helm upgrade autogpt-websocket-server ./autogpt-websocket-server \ | ||
--namespace ${{ env.NAMESPACE }} \ | ||
-f autogpt-websocket-server/values.yaml \ | ||
-f autogpt-websocket-server/values.dev.yaml \ | ||
--set image.tag=${{ github.sha }} | ||
- name: Deploy Market | ||
if: steps.check_changes.outputs.market_changed == 'true' | ||
run: | | ||
helm upgrade autogpt-market ./autogpt-market \ | ||
--namespace ${{ env.NAMESPACE }} \ | ||
-f autogpt-market/values.yaml \ | ||
-f autogpt-market/values.dev.yaml \ | ||
--set image.tag=${{ github.sha }} | ||
- name: Deploy Frontend | ||
if: steps.check_changes.outputs.frontend_changed == 'true' | ||
run: | | ||
helm upgrade autogpt-builder ./autogpt-builder \ | ||
--namespace ${{ env.NAMESPACE }} \ | ||
-f autogpt-builder/values.yaml \ | ||
-f autogpt-builder/values.dev.yaml \ | ||
--set image.tag=${{ github.sha }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Repo - Enforce dev as base branch | ||
on: | ||
pull_request_target: | ||
branches: [ master ] | ||
types: [ opened ] | ||
|
||
jobs: | ||
check_pr_target: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Check if PR is from dev or hotfix | ||
if: ${{ !(startsWith(github.event.pull_request.head.ref, 'hotfix/') || github.event.pull_request.head.ref == 'dev') }} | ||
run: | | ||
gh pr comment ${{ github.event.number }} --repo "$REPO" \ | ||
--body $'This PR targets the `master` branch but does not come from `dev` or a `hotfix/*` branch.\n\nAutomatically setting the base branch to `dev`.' | ||
gh pr edit ${{ github.event.number }} --base dev --repo "$REPO" | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
REPO: ${{ github.repository }} |
Oops, something went wrong.