Pulling Upstream refs/tags/4.1.1 into ortege #104
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
name: Build and Push Agent Image | |
on: | |
pull_request: | |
push: | |
branches: [ortege] | |
# tags: | |
# - '**' | |
release: | |
types: [released] | |
concurrency: | |
group: build-push-agents-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
GCP_PROJECT_ID: ortege-ai-426222 | |
GCP_REGION: us-east1 | |
jobs: | |
# build-and-push: | |
# if: "! contains(toJSON(github.event.commits.*.message), '[skip-action]')" | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# # build_preset: ["dev", "lean", "py310", "websocket", "dockerize"] | |
# build_preset: ["dev", "lean", "dockerize"] | |
# platform: ["linux/amd64"] | |
# fail-fast: false | |
# steps: | |
# - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" | |
# uses: actions/checkout@v4 | |
# - name: Set up Docker Buildx | |
# uses: docker/setup-buildx-action@v3 | |
# - name: Log into registry | |
# uses: docker/login-action@v2 | |
# with: | |
# registry: ${{ secrets.CR_ENDPOINT }} | |
# username: ${{ secrets.CR_USERNAME }} | |
# password: ${{ secrets.CR_PASSWORD }} | |
# - name: Set container registry token | |
# if: github.event_name == 'push' | |
# run: | | |
# echo "DOCKERHUB_TOKEN=${{ secrets.CR_PASSWORD }}" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# shell: bash | |
# env: | |
# DOCKERHUB_USER: ${{ secrets.CR_USERNAME }} | |
# DOCKERHUB_REPO: ${{ secrets.CR_ENDPOINT }}/ortege/studio | |
# MAIN_BRANCH: ortege | |
# run: | | |
# pip install click | |
# ./scripts/build_docker.py ${{ matrix.build_preset }} ${{ github.event_name }} --platform ${{ matrix.platform }} | |
build-and-push-gcp: | |
if: "! contains(toJSON(github.event.commits.*.message), '[skip-action]')" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# build_preset: ["dev", "lean", "py310", "websocket", "dockerize"] | |
build_preset: ["dev", "lean", "dockerize"] | |
platform: ["linux/amd64"] | |
fail-fast: false | |
steps: | |
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- id: auth | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: "${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}" | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: Use gcloud CLI | |
run: gcloud info | |
- name: Docker auth | |
run: |- | |
gcloud auth configure-docker ${{ env.GCP_REGION }}-docker.pkg.dev --quiet | |
# NOTE(joseb): we use gcloud auth for docker login instead of using `docker login` command in build_docker.py script. | |
# So we just set a dummy value for DOCKERHUB_TOKEN. | |
- name: Set container registry token | |
if: github.event_name == 'push' || github.event_name == 'release' | |
run: | | |
echo "DOCKERHUB_TOKEN=dummy" >> $GITHUB_ENV | |
- name: Build Docker Image | |
shell: bash | |
env: | |
DOCKERHUB_REPO: ${{ env.GCP_REGION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/ortege/studio | |
# NOTE(joseb): we use gcloud auth for docker login instead of using `docker login` command in build_docker.py script. | |
# So we just set a dummy value for DOCKERHUB_USER. | |
DOCKERHUB_USER: dummy | |
MAIN_BRANCH: ortege | |
run: | | |
pip install click | |
./scripts/build_docker.py ${{ matrix.build_preset }} ${{ github.event_name }} --platform ${{ matrix.platform }} |