Skip to content

Commit 6c6395e

Browse files
committed
test apply
1 parent 5b10b76 commit 6c6395e

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

.github/workflows/terraform_apply.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: 'Terraform apply'
22

33
on:
4+
push:
5+
branches: [ "main" ]
46
schedule:
57
- cron: "0 4 * * 1-5" # UTC standard -> KRT = UTC + 9, KRT 13:00 = 04:00 + 9
68

@@ -25,34 +27,36 @@ jobs:
2527

2628
# Install the latest version of Terraform CLI
2729
- name: Setup Terraform
28-
uses: hashicorp/setup-terraform@v1
30+
uses: hashicorp/setup-terraform@v3
2931

3032
# Configure AWS credentials
3133
- name: Configure AWS credentials
32-
uses: aws-actions/configure-aws-credentials@v1
33-
with:
34-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
35-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
36-
aws-region: ap-northeast-2
34+
run: |-
35+
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} --profile falconlee236
36+
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} --profile falconlee236
3737
3838
# Create .env file
3939
- name: Create .env file
4040
run: echo "WANDB_API_KEY=${{ secrets.WANDB_API_KEY }}" > .env
4141

4242
# Create terraform.prod.tfvars file
4343
- name: Create terraform.prod.tfvars file
44-
run: echo "dockerhub_id = ${{ secrets.DOCKERHUB_id }}" >> terraform.prod.tfvars
45-
- run: echo "dockerhub_pwd = ${{ secrets.DOCKERHUB_pwd }}" >> terraform.prod.tfvars
44+
run: |-
45+
cat > terraform.prod.tfvars <<EOF
46+
dockerhub_id="${{ secrets.DOCKERHUB_id }}"
47+
dockerhub_pwd ="${{ secrets.DOCKERHUB_pwd }}"
48+
EOF
4649
4750
# Create google cloud service account credential.json file
4851
- name: Configure GCP service account credentials
4952
run: echo "${{ secrets.GCP_SERVICE_ACCOUNT_JSON_VALUE }}" > credentials.json
5053

5154
# Create github ssh key directory
5255
- name: Configure github ssh
53-
run: mkdir .ssh
54-
- run: echo "${{ secrets.PUBLIC_KEY_GITHUB }}" > .ssh/id_ed25519.pub
55-
- run: echo "${{ secrets.SECRET_KEY_GITHUB }}" > .ssh/id_ed25519
56+
run: |-
57+
mkdir .ssh
58+
echo "${{ secrets.PUBLIC_KEY_GITHUB }}" > .ssh/id_ed25519.pub
59+
echo "${{ secrets.SECRET_KEY_GITHUB }}" > .ssh/id_ed25519
5660
5761
# Create GCP instance
5862
- name: Create GCP Compute Engine

0 commit comments

Comments
 (0)