diff --git a/.github/workflows/build-nightly.yaml b/.github/workflows/cloud-build-deploy-ci.yaml similarity index 90% rename from .github/workflows/build-nightly.yaml rename to .github/workflows/cloud-build-deploy-ci.yaml index 44c9f4ac..0ff50b49 100644 --- a/.github/workflows/build-nightly.yaml +++ b/.github/workflows/cloud-build-deploy-ci.yaml @@ -1,8 +1,8 @@ -name: CoPilot Build Nightly +name: CoPilot Build Cloud on: push: - branches: [ "dev" ] + branches: [ "cloud-main" ] workflow_dispatch: env: @@ -41,4 +41,4 @@ jobs: push: true tags: | ${{ env.IMAGE }} - tginternal/copilot:dev \ No newline at end of file + tginternal/copilot:cloud-latest \ No newline at end of file diff --git a/.github/workflows/build-deploy-ci.yaml b/.github/workflows/cloud-build-nightly.yaml similarity index 61% rename from .github/workflows/build-deploy-ci.yaml rename to .github/workflows/cloud-build-nightly.yaml index e5a8e04f..3d575674 100644 --- a/.github/workflows/build-deploy-ci.yaml +++ b/.github/workflows/cloud-build-nightly.yaml @@ -1,8 +1,8 @@ -name: CoPilot Build and Deploy +name: CoPilot Build Cloud Nightly on: push: - branches: [ "main" ] + branches: [ "cloud-dev" ] workflow_dispatch: env: @@ -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 }}"}]' \ No newline at end of file + tginternal/copilot:cloud-dev \ No newline at end of file diff --git a/.github/workflows/onprem-build-nightly.yaml b/.github/workflows/onprem-build-nightly.yaml new file mode 100644 index 00000000..11ba680d --- /dev/null +++ b/.github/workflows/onprem-build-nightly.yaml @@ -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 \ No newline at end of file diff --git a/.github/workflows/onprem-build.yaml b/.github/workflows/onprem-build.yaml new file mode 100644 index 00000000..f3c043cc --- /dev/null +++ b/.github/workflows/onprem-build.yaml @@ -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 \ No newline at end of file diff --git a/.github/workflows/pull-test-merge.yaml b/.github/workflows/pull-test-merge.yaml index b9402911..533dba97 100644 --- a/.github/workflows/pull-test-merge.yaml +++ b/.github/workflows/pull-test-merge.yaml @@ -4,6 +4,9 @@ on: pull_request: branches: - main + - dev + - cloud-main + - cloud-dev jobs: test: