Skip to content

Commit

Permalink
FEAT: workflow commented so it doesn't run
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewBL committed Jan 24, 2024
1 parent e624cec commit 461da9c
Showing 1 changed file with 55 additions and 56 deletions.
111 changes: 55 additions & 56 deletions .github/workflows/cd.yml
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

0 comments on commit 461da9c

Please sign in to comment.