Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 87 additions & 87 deletions .github/workflows/agent.yml
Original file line number Diff line number Diff line change
@@ -1,87 +1,87 @@
name: Build and Deploy Agent

on:
push:
paths:
- "agent/**"
branches:
- main
pull_request:
paths:
- "agent/**"
branches:
- 'main'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/muxable/rtchat-agent
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: ./agent
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
needs: build
concurrency:
group: deploy
cancel-in-progress: true
environment:
name: agent
url: https://console.cloud.google.com/compute/instanceGroups/details/us-central1-c/agent-small-us-central1?project=rtchat-47692

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: google-github-actions/auth@v1
with:
workload_identity_provider: 'projects/832669896677/locations/global/workloadIdentityPools/github-actions/providers/github-actions'
service_account: 'github-action-356868763@rtchat-47692.iam.gserviceaccount.com'

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0

- name: Deploy to GCE
id: deploy
run: |
gcloud compute instance-groups managed rolling-action start-update agent-small-us-central1 --project=rtchat-47692 --type='proactive' --max-surge=1 --max-unavailable=1 --minimal-action='replace' --replacement-method='substitute' --version=template=https://www.googleapis.com/compute/beta/projects/rtchat-47692/global/instanceTemplates/agent-e2-small --zone=us-central1-c
#name: Build and Deploy Agent
#
#on:
# push:
# paths:
# - "agent/**"
# branches:
# - main
# pull_request:
# paths:
# - "agent/**"
# branches:
# - 'main'
# workflow_dispatch:
#
#jobs:
# build:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
#
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
#
# - name: Log in to the Container registry
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v3
# with:
# images: ghcr.io/muxable/rtchat-agent
# tags: |
# type=ref,event=branch
# type=ref,event=pr
# type=semver,pattern={{version}}
# type=semver,pattern={{major}}.{{minor}}
#
# - name: Build and push Docker image
# uses: docker/build-push-action@v2
# with:
# context: ./agent
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
#
# deploy:
# if: github.ref == 'refs/heads/main'
# runs-on: ubuntu-latest
# permissions:
# id-token: write
# contents: read
# needs: build
# concurrency:
# group: deploy
# cancel-in-progress: true
# environment:
# name: agent
# url: https://console.cloud.google.com/compute/instanceGroups/details/us-central1-c/agent-small-us-central1?project=rtchat-47692
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
#
# - uses: google-github-actions/auth@v1
# with:
# workload_identity_provider: 'projects/832669896677/locations/global/workloadIdentityPools/github-actions/providers/github-actions'
# service_account: 'github-action-356868763@rtchat-47692.iam.gserviceaccount.com'
#
# - name: Set up Cloud SDK
# uses: google-github-actions/setup-gcloud@v0
#
# - name: Deploy to GCE
# id: deploy
# run: |
# gcloud compute instance-groups managed rolling-action start-update agent-small-us-central1 --project=rtchat-47692 --type='proactive' --max-surge=1 --max-unavailable=1 --minimal-action='replace' --replacement-method='substitute' --version=template=https://www.googleapis.com/compute/beta/projects/rtchat-47692/global/instanceTemplates/agent-e2-small --zone=us-central1-c
160 changes: 80 additions & 80 deletions .github/workflows/auxiliary.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
name: Build and Deploy Auxiliary

on:
push:
paths:
- "auxiliary/**"
branches:
- main
pull_request:
paths:
- "auxiliary/**"
branches:
- 'main'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/muxable/rtchat-auxiliary
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: ./auxiliary
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build
concurrency:
group: deploy
cancel-in-progress: true

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: google-github-actions/auth@v0
with:
credentials_json: ${{ secrets.SERVICE_ACCOUNT_JSON }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0

- name: Deploy to GCE
id: deploy
run: |
gcloud compute instance-groups managed rolling-action start-update auxiliary-us-central1 --version=template=auxiliary-e2-micro --zone=us-central1-a
#name: Build and Deploy Auxiliary
#
#on:
# push:
# paths:
# - "auxiliary/**"
# branches:
# - main
# pull_request:
# paths:
# - "auxiliary/**"
# branches:
# - 'main'
# workflow_dispatch:
#
#jobs:
# build:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
#
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
#
# - name: Log in to the Container registry
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v3
# with:
# images: ghcr.io/muxable/rtchat-auxiliary
# tags: |
# type=ref,event=branch
# type=ref,event=pr
# type=semver,pattern={{version}}
# type=semver,pattern={{major}}.{{minor}}
#
# - name: Build and push Docker image
# uses: docker/build-push-action@v2
# with:
# context: ./auxiliary
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
#
# deploy:
# if: github.ref == 'refs/heads/main'
# runs-on: ubuntu-latest
# needs: build
# concurrency:
# group: deploy
# cancel-in-progress: true
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
#
# - uses: google-github-actions/auth@v0
# with:
# credentials_json: ${{ secrets.SERVICE_ACCOUNT_JSON }}
#
# - name: Set up Cloud SDK
# uses: google-github-actions/setup-gcloud@v0
#
# - name: Deploy to GCE
# id: deploy
# run: |
# gcloud compute instance-groups managed rolling-action start-update auxiliary-us-central1 --version=template=auxiliary-e2-micro --zone=us-central1-a
Loading