Skip to content

Instantly share code, notes, and snippets.

@rasmuswikman
Created February 15, 2022 22:59
Show Gist options
  • Save rasmuswikman/cc6c39c1f3908203fcdfb7dfeaa2c205 to your computer and use it in GitHub Desktop.
Save rasmuswikman/cc6c39c1f3908203fcdfb7dfeaa2c205 to your computer and use it in GitHub Desktop.
mc-router-example-workflow.yaml
name: Deploy mc-router
on:
workflow_dispatch:
jobs:
setup-deploy:
name: Setup and deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Authenticate Cloud SDK
uses: google-github-actions/auth@v0
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- name: Setup Cloud SDK
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
- name: Set region and zone
run: |-
gcloud config set compute/region ${{ secrets.GCP_REGION }}
gcloud config set compute/zone ${{ secrets.GCP_ZONE }}
- name: Create cluster
run: |-
gcloud container clusters describe mc-router-cluster || \
gcloud container clusters create mc-router-cluster \
--num-nodes 2
- name: Setup GKE credentials
uses: google-github-actions/get-gke-credentials@v0
with:
cluster_name: mc-router-cluster
location: ${{ secrets.GCP_ZONE }}
- name: Deploy
run: |-
kubectl apply -f ./
kubectl get services -o wide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment