-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (42 loc) · 1.9 KB
/
deploy-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# name: Deploy Apply to
# on: [push, workflow_dispatch]
# jobs:
# deploy:
# runs-on: ubuntu-latest
# env:
# GOOGLE_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}
# DB_HOST: ${{ vars.DB_IP }}
# DB_USERNAME: ${{ vars.DB_USERNAME}}
# DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
# DB_NAME: "postgres"
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v2
# - name: Set up Cloud SDK
# uses: google-github-actions/[email protected]
# with:
# service_account_key: ${{ secrets.GCP_CREDENTIALS }}
# export_default_credentials: true
# - name: Configure Docker Client
# run: |-
# gcloud auth configure-docker --quiet
# gcloud auth configure-docker ${{ vars.REGION }}-docker.pkg.dev --quiet
# - name: Publish docker image on Google Artifactory Registry
# env:
# GOOGLE_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}
# run: |
# docker build -t ${{ vars.REGION }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/docker-images-rep/app:${{ github.run_id }} .
# docker push ${{ vars.REGION }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/docker-images-rep/app:${{ github.run_id }}
# - name: Authenticate with Google Cloud
# run: gcloud auth activate-service-account --key-file=${{ secrets.GCP_CREDENTIALS }}
# - name: Configure kubectl
# run: gcloud container clusters get-credentials ${{ vars.prefix }}-${{ vars.PROJECT_ID }}-gke --region ${{ vars.REGION }} --project ${{ vars.PROJECT_ID }}
# - name: Setup k8s configmap
# working-directory: k8s/
# run: kubectl apply -f your_manifest.yaml
# - name: Deploy deploymentto GKE
# working-directory: k8s/
# run: kubectl apply -f api-deployment.yaml
# - name: Deploy service to GKE
# working-directory: k8s/
# run: kubectl apply -f api-service.yaml