Skip to content

feat(k8s): GKE deployment #2

feat(k8s): GKE deployment

feat(k8s): GKE deployment #2

Workflow file for this run

name: Deploy to GKE
on:
push:
branches:
- master
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@1bee7de035d65ec5da40a31f8589e240eba8fde5
with:
project_id: ${{ secrets.GKE_PROJECT }}
service_account_key: ${{ secrets.GKE_SA_KEY }}
export_default_credentials: true
- name: Configure kubectl
run: |
gcloud container clusters get-credentials ${{ secrets.GKE_CLUSTER }} --zone ${{ secrets.GKE_ZONE }}
env:
KUBECONFIG: ${{ runner.workspace }}/kubeconfig.yaml
- name: Deploy to GKE
run: |
kubectl apply -f k8s/
working-directory: multicontainer-k8s
# GKE_CLUSTER FAIT REF (cat docker-k8s-403619-30994923a33e.json | base64) le fichier json est le service account générer depuis google en donnant les permissions kubernetes engine admin au service account
# GKE_PROJECT FAIT REF à l'id du projet dans le fichier json
# GKE_CLUSTER est le nom de votre cluster
# GKE_ZONE est la zone définit de votre cluster