Merge pull request #30 from CSCI-5828-S24/stage #1
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 Push to Docker Hub | |
on: | |
push: | |
branches: | |
- main | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Google Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0.2.0 | |
with: | |
service_account_key: ${{ secrets.GCP_SA_KEY_PROD }} | |
project_id: ${{ vars.GCP_PROJECT_ID_PROD }} | |
export_default_credentials: true | |
- name: Install kubectl | |
run: | | |
gcloud components install kubectl | |
gcloud components install gke-gcloud-auth-plugin | |
- name: Authenticate with Google Cloud | |
run: | | |
printf "%s" '${{ secrets.GCP_SA_KEY_PROD }}' > key.json | |
gcloud auth activate-service-account --key-file=key.json | |
- name: Set up Kubernetes cluster context | |
run: gcloud container clusters get-credentials ${{ vars.GCP_CLUSTER_NAME_PROD }} --zone ${{ vars.GCP_CLUSTER_ZONE_PROD}} --project ${{ vars.GCP_PROJECT_ID_PROD }} | |
- name: Configure Helm and add kube-prometheus-stack repository | |
run: | | |
helm repo add stable https://charts.helm.sh/stable | |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | |
helm repo update | |
- name: Upgrade Helm chart | |
run: | | |
helm upgrade --install main ./ad-devops/helm/ad-pulse --values ./ad-devops/helm/ad-pulse/values.yaml --namespace=adpulse --set ad_server_url="http://34.66.199.64:8080" --set ad_manager_url="http://34.121.57.232:5000" --set ad_engagement_svc_clk="http://34.31.189.11:8081/engagement/clk" --set ad_engagement_svc_rndr="http://34.31.189.11:8081/engagement/csc" |