generated from fis-g4/sample-microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEAT: workflow commented so it doesn't run
- Loading branch information
Showing
1 changed file
with
55 additions
and
56 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,66 @@ | ||
name: Deploy to GCE | ||
# name: Deploy to GCE | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
# on: | ||
# push: | ||
# branches: | ||
# - "main" | ||
|
||
env: | ||
ENV_CONFIGURATION: ${{ secrets.ENV_CONFIGURATION }} | ||
TERRAFORM_VARS: ${{ secrets.TERRAFORM_VARS }} | ||
GCP_CREDENTIALS: ${{ secrets.ENCODED_GCP_CREDENTIALS }} | ||
# env: | ||
# ENV_CONFIGURATION: ${{ secrets.ENV_CONFIGURATION }} | ||
# TERRAFORM_VARS: ${{ secrets.TERRAFORM_VARS }} | ||
# GCP_CREDENTIALS: ${{ secrets.ENCODED_GCP_CREDENTIALS }} | ||
|
||
jobs: | ||
deploy-flatter-to-gce: | ||
name: Courses Microservice Deployment to GCE | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
# jobs: | ||
# deploy-flatter-to-gce: | ||
# name: Courses Microservice Deployment to GCE | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v3 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: 1.4.6 | ||
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} | ||
terraform_wrapper: false | ||
# - name: Setup Terraform | ||
# uses: hashicorp/setup-terraform@v2 | ||
# with: | ||
# terraform_version: 1.4.6 | ||
# cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} | ||
# terraform_wrapper: false | ||
|
||
- name: Populate terraform variables | ||
working-directory: ./terraform | ||
run: |- | ||
mkdir .ssh | ||
ssh-keygen -f .ssh/coursesServiceSsh -t rsa -N "" | ||
echo "$GCP_CREDENTIALS" | base64 --decode > GoogleCloudKey.json | ||
echo "$TERRAFORM_VARS" | base64 --decode > terraform.tfvars | ||
echo "$ENV_CONFIGURATION" | base64 --decode > .env.prod | ||
# working-directory: ./terraform | ||
# run: |- | ||
# mkdir .ssh | ||
# ssh-keygen -f .ssh/coursesServiceSsh -t rsa -N "" | ||
# echo "$GCP_CREDENTIALS" | base64 --decode > GoogleCloudKey.json | ||
# echo "$TERRAFORM_VARS" | base64 --decode > terraform.tfvars | ||
# echo "$ENV_CONFIGURATION" | base64 --decode > .env.prod | ||
|
||
- name: Terraform Format | ||
id: fmt | ||
run: terraform fmt | ||
continue-on-error: true | ||
working-directory: ./terraform | ||
# - name: Terraform Format | ||
# id: fmt | ||
# run: terraform fmt | ||
# continue-on-error: true | ||
# working-directory: ./terraform | ||
|
||
- name: Terraform Init | ||
id: init | ||
run: terraform init | ||
working-directory: ./terraform | ||
# - name: Terraform Init | ||
# id: init | ||
# run: terraform init | ||
# working-directory: ./terraform | ||
|
||
- name: Terraform Validate | ||
id: validate | ||
run: terraform validate -no-color | ||
working-directory: ./terraform | ||
# - name: Terraform Validate | ||
# id: validate | ||
# run: terraform validate -no-color | ||
# working-directory: ./terraform | ||
|
||
- name: Terraform Destroy | ||
id: destroy | ||
run: terraform destroy -target=google_compute_instance.courses-service-instance -auto-approve -input=false -no-color | ||
working-directory: ./terraform | ||
continue-on-error: true | ||
# - name: Terraform Destroy | ||
# id: destroy | ||
# run: terraform destroy -target=google_compute_instance.courses-service-instance -auto-approve -input=false -no-color | ||
# working-directory: ./terraform | ||
# continue-on-error: true | ||
|
||
- name: Terraform Plan | ||
id: plan | ||
run: | | ||
terraform plan -input=false -no-color | ||
working-directory: ./terraform | ||
# - name: Terraform Plan | ||
# id: plan | ||
# run: | | ||
# terraform plan -input=false -no-color | ||
# working-directory: ./terraform | ||
|
||
- name: Terraform Apply | ||
run: terraform apply -auto-approve -input=false -no-color | ||
working-directory: ./terraform | ||
# - name: Terraform Apply | ||
# run: terraform apply -auto-approve -input=false -no-color | ||
# working-directory: ./terraform |