update #42
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: Deploy to Kubernetes | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Google Cloud SDK | |
run: | | |
curl -o google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-372.0.0-linux-x86_64.tar.gz | |
tar -xf google-cloud-sdk.tar.gz | |
./google-cloud-sdk/install.sh --quiet | |
echo "${{ secrets.GCLOUD_AUTH }}" > /tmp/gcloud.json | |
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcloud.json | |
./google-cloud-sdk/bin/gcloud config set project ${{ secrets.GCP_PROJECT_ID }} | |
- name: Set kubectl context | |
run: | | |
gcloud container clusters get-credentials autopilot-cluster-1 --region asia-southeast1 --project cdtest-406103 | |
- name: Deploy to Kubernetes | |
run: | | |
ls | |
pwd | |
kubectl apply -f deployment.yaml |