Add CI/CD workflow #2
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 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="" \ |