test
This commit is contained in:
parent
1fcbf0e33a
commit
e3c9658491
95
.github/workflows/deploy_to_gcp.yml
vendored
95
.github/workflows/deploy_to_gcp.yml
vendored
@ -6,7 +6,6 @@ on:
|
||||
branches:
|
||||
- deploy-prd
|
||||
- deploy-dev
|
||||
|
||||
jobs:
|
||||
gcp-deploy:
|
||||
name: Deploy to GCP
|
||||
@ -22,73 +21,39 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Check Deploy Tools
|
||||
run: |
|
||||
ls -la
|
||||
echo "Checking gcloud and terraform versions..."
|
||||
gcloud --version
|
||||
terraform --version
|
||||
|
||||
- name: Check Gcloud auth
|
||||
run: |
|
||||
echo "HOME: ${HOME}"
|
||||
printf '%s' "$GCP_SA_KEY" > $HOME/sa.json
|
||||
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/sa.json"
|
||||
|
||||
gcloud auth activate-service-account --key-file="$GOOGLE_APPLICATION_CREDENTIALS"
|
||||
gcloud config set project "$GCP_PROJECT_ID"
|
||||
|
||||
echo "Check gcloud"
|
||||
gcloud config list
|
||||
gcloud --version
|
||||
|
||||
- name: Exec Terraform init shell
|
||||
run: |
|
||||
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/sa.json"
|
||||
./scripts/deploy/init_terraform.sh
|
||||
|
||||
- name: Exec Container Image Push to Artifact Registry
|
||||
run: |
|
||||
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/sa.json"
|
||||
./scripts/deploy/build_image_to_gar.sh
|
||||
|
||||
- name: Exec Terraform plan shell
|
||||
run: |
|
||||
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/sa.json"
|
||||
./scripts/deploy/plan_terraform.sh
|
||||
|
||||
|
||||
|
||||
# steps:
|
||||
# - name: Checkout code
|
||||
# uses: actions/checkout@v3
|
||||
|
||||
# checkout:
|
||||
# name: Checkout code
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Checkout code
|
||||
# uses: actions/checkout@v3
|
||||
|
||||
# gcp-deploy:
|
||||
# name: Deploy to GCP
|
||||
# runs-on: gcloud-tf
|
||||
# steps:
|
||||
# - name: Check Deploy Tools
|
||||
# run: |
|
||||
# ls -la
|
||||
# echo "Checking gcloud and terraform versions..."
|
||||
# gcloud --version
|
||||
# terraform --version
|
||||
# ls -la
|
||||
|
||||
|
||||
# - name: Set up Cloud SDK
|
||||
# uses: google-github-actions/setup-gcloud@v1
|
||||
# with:
|
||||
# project_id: ${{ secrets.GCP_PROJECT_ID }}
|
||||
# service_account_key: ${{ secrets.GCP_SA_KEY }}
|
||||
# export_default_credentials: true
|
||||
|
||||
# - name: Run deployment script
|
||||
# - name: Check Gcloud auth
|
||||
# run: |
|
||||
# chmod +x ./deploy.sh
|
||||
# ./deploy.sh
|
||||
# echo "HOME: ${HOME}"
|
||||
# printf '%s' "$GCP_SA_KEY" > $HOME/sa.json
|
||||
# export GOOGLE_APPLICATION_CREDENTIALS="$HOME/sa.json"
|
||||
|
||||
# gcloud auth activate-service-account --key-file="$GOOGLE_APPLICATION_CREDENTIALS"
|
||||
# gcloud config set project "$GCP_PROJECT_ID"
|
||||
|
||||
# echo "Check gcloud"
|
||||
# gcloud config list
|
||||
# gcloud --version
|
||||
|
||||
# - name: Exec Terraform init shell
|
||||
# run: |
|
||||
# export GOOGLE_APPLICATION_CREDENTIALS="$HOME/sa.json"
|
||||
# ./scripts/deploy/init_terraform.sh
|
||||
|
||||
# - name: Exec Container Image Push to Artifact Registry
|
||||
# run: |
|
||||
# export GOOGLE_APPLICATION_CREDENTIALS="$HOME/sa.json"
|
||||
# ./scripts/deploy/build_image_to_gar.sh
|
||||
|
||||
# - name: Exec Terraform plan shell
|
||||
# run: |
|
||||
# export GOOGLE_APPLICATION_CREDENTIALS="$HOME/sa.json"
|
||||
# ./scripts/deploy/plan_terraform.sh
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user