Skip to content

Commit

Permalink
Merge pull request #180 from tigergraph/GML-1728-ci-changes
Browse files Browse the repository at this point in the history
update(build): update builds for cloud and on-prem branches
  • Loading branch information
parkererickson-tg authored Jun 4, 2024
2 parents 6911043 + 6c5fd95 commit 641af77
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: CoPilot Build Nightly
name: CoPilot Build Cloud

on:
push:
branches: [ "dev" ]
branches: [ "cloud-main" ]
workflow_dispatch:

env:
Expand Down Expand Up @@ -41,4 +41,4 @@ jobs:
push: true
tags: |
${{ env.IMAGE }}
tginternal/copilot:dev
tginternal/copilot:cloud-latest
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: CoPilot Build and Deploy
name: CoPilot Build Cloud Nightly

on:
push:
branches: [ "main" ]
branches: [ "cloud-dev" ]
workflow_dispatch:

env:
Expand Down Expand Up @@ -41,17 +41,4 @@ jobs:
push: true
tags: |
${{ env.IMAGE }}
tginternal/copilot:latest
deploy:
needs: [build-image]
runs-on: ubuntu-latest
steps:
- name: Login to k8s
uses: tale/kubectl-action@v1
with:
base64-kube-config: ${{ secrets.KUBE_CONFIG }}

- name: Deploy in k8s
run: |
kubectl patch tigergraph/tg-47f94070-fa64-4191-b952-983dafabd8fb -n 22a77be0-fb48-479d-b517-b6868326edd6 --type=json -p='[{"op":"replace","path":"/spec/sidecarContainers/1/image","value":"${{ needs.build-image.outputs.image }}"}]'
tginternal/copilot:cloud-dev
44 changes: 44 additions & 0 deletions .github/workflows/onprem-build-nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CoPilot Build Nightly

on:
push:
branches: [ "dev" ]
workflow_dispatch:

env:
SHA: ${{ github.sha }}

jobs:
build-image:
runs-on: ubuntu-latest
outputs:
image: ${{steps.get-image.outputs.IMAGE}}
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.PUBLIC_DOCKERHUB_USERNAME }}
password: ${{ secrets.PUBLIC_DOCKERHUB_TOKEN }}

- name: Get Image tag
id: get-image
run: |
IMAGE=tginternal/copilot:${SHA::6}
echo "IMAGE=$IMAGE" >> $GITHUB_ENV
echo "IMAGE=$IMAGE" >> $GITHUB_OUTPUT${{ needs.setup.outputs.image }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ env.IMAGE }}
tginternal/copilot:dev
44 changes: 44 additions & 0 deletions .github/workflows/onprem-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CoPilot Build Cloud

on:
push:
branches: [ "main" ]
workflow_dispatch:

env:
SHA: ${{ github.sha }}

jobs:
build-image:
runs-on: ubuntu-latest
outputs:
image: ${{steps.get-image.outputs.IMAGE}}
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.PUBLIC_DOCKERHUB_USERNAME }}
password: ${{ secrets.PUBLIC_DOCKERHUB_TOKEN }}

- name: Get Image tag
id: get-image
run: |
IMAGE=tginternal/copilot:${SHA::6}
echo "IMAGE=$IMAGE" >> $GITHUB_ENV
echo "IMAGE=$IMAGE" >> $GITHUB_OUTPUT${{ needs.setup.outputs.image }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ env.IMAGE }}
tginternal/copilot:latest
3 changes: 3 additions & 0 deletions .github/workflows/pull-test-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches:
- main
- dev
- cloud-main
- cloud-dev

jobs:
test:
Expand Down

0 comments on commit 641af77

Please sign in to comment.