-
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (38 loc) · 1.41 KB
/
manual-development-environment.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
name: "[Manual] Development environment"
on:
workflow_dispatch:
inputs:
power:
description: "Power"
required: true
type: choice
options:
- true
- false
jobs:
job:
runs-on: ubuntu-latest
steps:
- uses: hashicorp/setup-terraform@v1
- uses: actions/checkout@v2
- name: Extract secrets
env:
GOOGLE_ENVIRONMENT_TARGET: development
GOOGLE_POWER: ${{ github.event.inputs.power }}
LOGFLARE_URI: /logs/json?api_key=${{ secrets.LOGFLARE_API_KEY }}&source=f57030a7-1bc8-4600-a11b-29518e2e42c4
TF_GOOGLE_CREDENTIAL_FILE: ${{ secrets.TF_GOOGLE_CREDENTIAL_FILE }}
TF_ROOT_CRT_FILE: ${{ secrets.TF_ROOT_CRT_FILE }}
TF_ROOT_KEY_FILE: ${{ secrets.TF_ROOT_KEY_FILE }}
TF_TERRAFORM_TFVARS: ${{ secrets.TF_TERRAFORM_TFVARS }}
working-directory: ./root
run: ./scripts/extract-secrets.sh
- name: Reverse terraform
working-directory: ./root
run: ./scripts/reverse-terraform.sh
- name: Terraform
working-directory: ./root
run: |
terraform apply -auto-approve | sed --regexp-extended 's/value: \"[^\"]+\"/value: \"****\"/g'
- name: Print outputs
run: |
[ ${{ github.event.inputs.power }} = true ] && echo '::notice::サーバーは起動状態です' || echo '::notice::サーバーは停止状態です'