mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49:11 +00:00
update deploy
This commit is contained in:
parent
820f2005c4
commit
26f00eaf22
1 changed files with 12 additions and 5 deletions
17
.github/workflows/deploy.yml
vendored
17
.github/workflows/deploy.yml
vendored
|
@ -102,8 +102,8 @@ jobs:
|
||||||
- name: Set up Cloud SDK
|
- name: Set up Cloud SDK
|
||||||
uses: google-github-actions/setup-gcloud@master
|
uses: google-github-actions/setup-gcloud@master
|
||||||
with:
|
with:
|
||||||
project_id: ${{ secrets.GCP_PROJECT_ID }}
|
project_id: ${{ secrets.GCS_PROJECT_ID }}
|
||||||
service_account_key: ${{ secrets.GCP_TF_KEY }}
|
service_account_key: ${{ secrets.GCS_TF_KEY }}
|
||||||
export_default_credentials: true
|
export_default_credentials: true
|
||||||
|
|
||||||
- name: Pull necessary artifacts
|
- name: Pull necessary artifacts
|
||||||
|
@ -112,7 +112,7 @@ jobs:
|
||||||
selectedTargetArtifact=${${{ event.inputs.worker_tag }}:-$currentHash}
|
selectedTargetArtifact=${${{ event.inputs.worker_tag }}:-$currentHash}
|
||||||
|
|
||||||
mkdir worker-dist
|
mkdir worker-dist
|
||||||
gsutil cp gs://roleypoly-artifacts/backend-worker/$selectedTargetArtifact worker-dist/backend-worker.js
|
gsutil cp gs://roleypoly-artifacts/backend-worker/$selectedTargetArtifact/script.js worker-dist/backend-worker.js
|
||||||
|
|
||||||
- run: terraform init --backend-config "prefix=${{event.inputs.environment}}"
|
- run: terraform init --backend-config "prefix=${{event.inputs.environment}}"
|
||||||
|
|
||||||
|
@ -122,11 +122,18 @@ jobs:
|
||||||
|
|
||||||
- name: Write TF_DATA_${{event.inputs.environment}} to actions.tfvars.auto.json
|
- name: Write TF_DATA_${{event.inputs.environment}} to actions.tfvars.auto.json
|
||||||
run: |
|
run: |
|
||||||
sh -c 'echo $TF_DATA | jq > actions.tfvars.auto.json' >/dev/null 2>&1
|
sh -c 'echo '$TF_DATA' | jq > actions.tfvars.auto.json' >/dev/null 2>&1
|
||||||
env:
|
env:
|
||||||
TF_DATA: ${{ secrets['TF_DATA_'+event.inputs.environment] }}
|
TF_DATA: ${{ secrets['TF_DATA_'+event.inputs.environment] }}
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
terraform plan \
|
terraform plan \
|
||||||
--var-file variables/global.tfvars \
|
--var-file variables/global.tfvars \
|
||||||
--var-file variables/${{event.inputs.environment}}.tfvars
|
--var-file variables/${{event.inputs.environment}}.tfvars \
|
||||||
|
-out=./deployment.tfplan
|
||||||
|
|
||||||
|
- run: |
|
||||||
|
terraform apply \
|
||||||
|
--var-file variables/global.tfvars \
|
||||||
|
--var-file variables/${{event.inputs.environment}}.tfvars \
|
||||||
|
deployment.tfplan
|
||||||
|
|
Loading…
Add table
Reference in a new issue