Update NuGet Packages - Minor Updates (#554) #251
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: Continuous Deployment | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
env: | |
PROJECT_ID: ${{ secrets.GKE_PROJECT }} | |
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER_NAME }} | |
GKE_ZONE: us-east1-b | |
DEPLOYMENT_NAME: coding-blog-deployment | |
IMAGE: coding-blog | |
jobs: | |
build-publish-deploy: | |
name: build, publish, and deploy | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: checkout code | |
id: checkout-code | |
uses: actions/checkout@v4 | |
- name: 🔐 authorize gcloud | |
id: authorize-gcloud | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: ${{ secrets.GKE_SA_KEY }} | |
- name: ☁ setup gcloud cli | |
id: setup-gcloud | |
uses: google-github-actions/[email protected] | |
with: | |
project_id: ${{ secrets.GKE_PROJECT }} | |
- name: 🔧 configure docker | |
id: configure-docker | |
run: |- | |
gcloud --quiet auth configure-docker | |
- name: 🚢 configure kubectl | |
id: configure-kubectl | |
uses: google-github-actions/[email protected] | |
with: | |
cluster_name: ${{ env.GKE_CLUSTER }} | |
location: ${{ env.GKE_ZONE }} | |
- name: 🐳 build docker image | |
id: build-docker-image | |
run: |- | |
docker build -f "src/Coding.Blog/Coding.Blog/Dockerfile" \ | |
--tag "gcr.io/$PROJECT_ID/$IMAGE" \ | |
"src" | |
- name: 🐋 publish docker image | |
id: publish-docker-image | |
run: |- | |
docker push "gcr.io/$PROJECT_ID/$IMAGE" | |
- name: 🚀 deploy | |
id: deploy | |
run: |- | |
kubectl rollout restart deployment/$DEPLOYMENT_NAME |