Skip to content

update: reuse deploy gke #1

update: reuse deploy gke

update: reuse deploy gke #1

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@v4
- id: 'auth'
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GKE_SA_KEY }}
- run: |-
gcloud --quiet auth configure-docker
- id: 'get-credentials'
uses: google-github-actions/get-gke-credentials@v1
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
# credentials: ${{ secrets.GKE_SA_KEY }}
# project_id: ${{ secrets.GKE_PROJECT }}
- 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