Skip to content

Commit 94235ab

Browse files
Merge remote-tracking branch 'origin/fix-ami' into staging
2 parents 304c459 + e5dc323 commit 94235ab

2 files changed

Lines changed: 55 additions & 26 deletions

File tree

.github/workflows/continuos_deployment_production.yml

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -71,29 +71,12 @@ jobs:
7171
unset AWS_PROFILE
7272
terraform plan -out planfile
7373
74-
# ---------------------
75-
- name: Terraform apply
76-
run: |
77-
cd terraform
78-
cat .envrc | grep -vE '^(dotenv_if_exists|source_env)' > .envrc.good
79-
. ./.envrc.good
80-
cd ${{ env.ENVIRONMENT }}
81-
cat .envrc | grep -vE '^(dotenv_if_exists|source_env)' > .envrc.good
82-
. ./.envrc.good
83-
unset AWS_PROFILE
84-
terraform apply -input=false planfile
85-
86-
# --------------------------------------------------------------------------------------
87-
# - name: Post Deploy - Test Service for Server has Correct Task Definition Deployed
88-
# run: |
89-
# cd terraform
90-
# cat .envrc | grep -vE '^(dotenv_if_exists|source_env)' > .envrc.good
91-
# . ./.envrc.good
92-
# cd ${{ env.ENVIRONMENT }}
93-
# cat .envrc | grep -vE '^(dotenv_if_exists|source_env)' > .envrc.good
94-
# . ./.envrc.good
95-
# unset AWS_PROFILE
96-
# export ECS_CLUSTER_NAME_SERVER=$(terraform output -raw error_logs_server_cluster_name)
97-
# export ECS_SERVICE_NAME_SERVER=$(terraform output -raw error_logs_server_service_name)
98-
# export ECS_TASK_DEFINITION_SERVER=$(terraform output -raw error_logs_server_task_definition_revision)
99-
# ../test_deployed_task_definitions.sh "${AWS_REGION}" "${ECS_CLUSTER_NAME_SERVER}" "${ECS_SERVICE_NAME_SERVER}" "${ECS_TASK_DEFINITION_SERVER}"
74+
# Upload the plan as an artifact
75+
- name: Upload Terraform plan
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: terraform-${{ env.ENVIRONMENT }}-plan
79+
path: terraform/${{ env.ENVIRONMENT }}/planfile
80+
if-no-files-found: 'warn'
81+
retention-days: 1
82+
overwrite: true
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Continuos Deployment Action Production Apply Changes
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_PLAY_DEVOPS }}
8+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_PLAY_DEVOPS }}
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
terraform_apply:
16+
runs-on: ubuntu-latest
17+
environment: production
18+
19+
env:
20+
ETHEREUM_PEM: ${{ secrets.ETHEREUM_PEM }}
21+
ENVIRONMENT: production
22+
GF_SECURITY_ADMIN_USER: "${{ secrets.GF_SECURITY_ADMIN_USER }}"
23+
GF_SECURITY_ADMIN_PASSWORD: "${{ secrets.GF_SECURITY_ADMIN_PASSWORD }}"
24+
PROMETHEUS_ADMIN_PASSWORD: "${{ secrets.PROMETHEUS_ADMIN_PASSWORD }}"
25+
PROMETHEUS_ADMIN_PASSWORD_BCRYPTED: "${{ secrets.PROMETHEUS_ADMIN_PASSWORD_BCRYPTED }}"
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
31+
- name: Download Terraform plan
32+
uses: actions/download-artifact@v4
33+
with:
34+
name: terraform-${{ env.ENVIRONMENT }}-plan
35+
path: terraform/${{ env.ENVIRONMENT }}
36+
37+
- name: Terraform apply
38+
run: |
39+
cd terraform
40+
cat .envrc | grep -vE '^(dotenv_if_exists|source_env)' > .envrc.good
41+
. ./.envrc.good
42+
cd ${{ env.ENVIRONMENT }}
43+
cat .envrc | grep -vE '^(dotenv_if_exists|source_env)' > .envrc.good
44+
. ./.envrc.good
45+
unset AWS_PROFILE
46+
terraform apply -input=false planfile

0 commit comments

Comments
 (0)