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-c | |
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 DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Build images | |
run: |- | |
cd webapp | |
docker build \ | |
--tag docker.io/levaitamas/webrtc-observer-webapp \ | |
--build-arg host="wss://media.webrtc-observer.org:443" \ | |
. | |
cd ../media-server | |
docker build \ | |
--tag docker.io/levaitamas/webrtc-observer-mediaserver \ | |
. | |
- name: Push images | |
run: |- | |
docker tag \ | |
docker.io/levaitamas/webrtc-observer-webapp \ | |
docker.io/levaitamas/webrtc-observer-webapp:$GITHUB_SHA | |
docker push --all-tags docker.io/levaitamas/webrtc-observer-webapp | |
docker tag \ | |
docker.io/levaitamas/webrtc-observer-mediaserver \ | |
docker.io/levaitamas/webrtc-observer-mediaserver:$GITHUB_SHA | |
docker push --all-tags 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 | |
- name: Deploy on GKE | |
run: | | |
helm upgrade webrtc-observer-org charts/webrtc-observer-org \ | |
--set webapp.image=docker.io/levaitamas/webrtc-observer-webapp:$GITHUB_SHA \ | |
--set mediaserver.image=docker.io/levaitamas/webrtc-observer-mediaserver:$GITHUB_SHA |