Created
February 15, 2022 22:59
-
-
Save rasmuswikman/cc6c39c1f3908203fcdfb7dfeaa2c205 to your computer and use it in GitHub Desktop.
mc-router-example-workflow.yaml
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: 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