Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 01197d81 authored by Muhammad Raihan Akbar's avatar Muhammad Raihan Akbar
Browse files

[REFACTOR] added continuous deployment for staging environment

parent 94d37fa4
No related branches found
No related tags found
1 merge request!1Login registration
......@@ -40,16 +40,34 @@ jobs:
uses: actions/checkout@v3
- name: Install the gcloud CLI
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GOOGLE_PROJECT }}
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
export_default_credentials: true
- name: Authenticate with GCP
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
- name: Build and Push Docker Image
env:
GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }}
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev
docker build -t us-central1-docker.pkg.dev/$GOOGLE_PROJECT/my-repository/authentication:latest .
docker push us-central1-docker.pkg.dev/$GOOGLE_PROJECT/my-repository/authentication:latest
\ No newline at end of file
docker build -t us-central1-docker.pkg.dev/$GOOGLE_PROJECT/staging-repository/authentication:latest .
docker push us-central1-docker.pkg.dev/$GOOGLE_PROJECT/staging-repository/authentication:latest
- name: Install required components
run: |
gcloud components update
gcloud components install gke-gcloud-auth-plugin
- name: Deploy to GKE
env:
GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }}
run: |
gcloud container clusters get-credentials safetypin-staging --region asia-southeast2
sed -i "s/GOOGLE_PROJECT/$GOOGLE_PROJECT/g" resources.yaml
kubectl apply -f resources.yaml
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment