-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5eabfb
commit 1a7a1d9
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
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://webrtc-observer.org:9081" \ | ||
. | ||
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 install 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 \ |