diff --git a/.github/workflows/deploy-gke.yaml b/.github/workflows/deploy-gke.yaml new file mode 100644 index 0000000..3ab4d42 --- /dev/null +++ b/.github/workflows/deploy-gke.yaml @@ -0,0 +1,68 @@ +name: Build and Deploy to GKE + +on: + workflow_dispatch: + push: + branches: + - '*' + +env: + GKE_CLUSTER: webrtc-observer + GKE_ZONE: us-east1 + +jobs: + setup-build-publish-deploy: + name: Setup, Build, Publish, and Deploy + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Build images + run: |- + cd webapp + docker build docker.io/levaitamas/webrtc-observer-webapp + --build-arg host="wss://webrtc-observer.org:9081" \ + . + cd ../media-server + docker build docker.io/levaitamas/webrtc-observer-mediaserver + . + + - name: Publish + run: |- + docker push docker.io/levaitamas/webrtc-observer-webapp + docker push docker.io/levaitamas/webrtc-observer-mediaserver + + + - name: Authenticate on GKE + id: auth + uses: google-github-actions/auth@v2 + with: + credentials_json: '${{ secrets.GKE_SA_KEY }}' + + - name: Get GKE Credentials + id: get-credentials + uses: 'google-github-actions/get-gke-credentials@v2' + with: + cluster_name: ${{ env.GKE_CLUSTER }} + location: ${{ env.GKE_ZONE }} + + - name: Set up Helm + uses: azure/setup-helm@v4 + + - run: | + kubectl get nodes -o wide + + # - name: Deploy on GKE + # run: | + # helm install webrtc-observer-org charts/webrtc-observer-org \ + # --set webapp.image="" \ + # --set mediaserver.image="" \