generated from fis-g4/sample-microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 1.99 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# name: Deploy to GCE
# on:
# push:
# branches:
# - "main"
# 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
# - 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
# 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 Init
# id: init
# run: terraform init
# 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 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