mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49:11 +00:00
set working-directory for tf runs
This commit is contained in:
parent
d5094f94f9
commit
441b24045d
1 changed files with 11 additions and 10 deletions
21
.github/workflows/deploy.yml
vendored
21
.github/workflows/deploy.yml
vendored
|
@ -97,8 +97,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
terraform_version: ^0.14.0
|
terraform_version: ^0.14.0
|
||||||
|
|
||||||
- run: cd terraform
|
|
||||||
|
|
||||||
- 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:
|
||||||
|
@ -107,6 +105,7 @@ jobs:
|
||||||
export_default_credentials: true
|
export_default_credentials: true
|
||||||
|
|
||||||
- name: Pull necessary artifacts
|
- name: Pull necessary artifacts
|
||||||
|
working-directory: ./terraform
|
||||||
run: |
|
run: |
|
||||||
currentHash=${{ github.sha }}
|
currentHash=${{ github.sha }}
|
||||||
targetArtifact=${{ github.event.inputs.worker_tag }}
|
targetArtifact=${{ github.event.inputs.worker_tag }}
|
||||||
|
@ -115,25 +114,27 @@ jobs:
|
||||||
mkdir worker-dist
|
mkdir worker-dist
|
||||||
gsutil cp gs://roleypoly-artifacts/backend-worker/$selected/script.js worker-dist/backend-worker.js
|
gsutil cp gs://roleypoly-artifacts/backend-worker/$selected/script.js worker-dist/backend-worker.js
|
||||||
|
|
||||||
- run: terraform init --backend-config "prefix=${{github.event.inputs.environment}}"
|
- name: Terraform init
|
||||||
|
working-directory: ./terraform
|
||||||
|
run: |
|
||||||
|
terraform init --backend-config "prefix=${{github.event.inputs.environment}}"
|
||||||
|
|
||||||
- name: Write tags to tags.tfvars.auto.json
|
- name: Write tags to tags.tfvars.auto.json
|
||||||
|
working-directory: ./terraform
|
||||||
run: |
|
run: |
|
||||||
echo '{"ui_tag": "${{needs.docker_sync.outputs.ui_tag}}", "bot_tag": "${{needs.docker_sync.outputs.bot_tag}}", "worker_path": "./worker-dist/backend-worker.js"}' | jq . | tee tags.tfvars.auto.json
|
echo '{"ui_tag": "${{needs.docker_sync.outputs.ui_tag}}", "bot_tag": "${{needs.docker_sync.outputs.bot_tag}}", "worker_path": "./worker-dist/backend-worker.js"}' | jq . | tee tags.tfvars.auto.json
|
||||||
|
|
||||||
- name: Write TF_DATA_${{github.event.inputs.environment}} to actions.tfvars.auto.json
|
- name: Terraform plan
|
||||||
|
working-directory: ./terraform
|
||||||
run: |
|
run: |
|
||||||
echo $TF_DATA > actions.tfvars.auto.json
|
|
||||||
env:
|
|
||||||
TF_DATA: ${{ secrets[format('TF_DATA_{0}', github.event.inputs.environment)] }}
|
|
||||||
|
|
||||||
- run: |
|
|
||||||
terraform plan \
|
terraform plan \
|
||||||
--var-file variables/global.tfvars \
|
--var-file variables/global.tfvars \
|
||||||
--var-file variables/${{github.event.inputs.environment}}.tfvars \
|
--var-file variables/${{github.event.inputs.environment}}.tfvars \
|
||||||
-out=./deployment.tfplan
|
-out=./deployment.tfplan
|
||||||
|
|
||||||
- run: |
|
- name: Terraform apply
|
||||||
|
working-directory: ./terraform
|
||||||
|
run: |
|
||||||
terraform apply \
|
terraform apply \
|
||||||
--var-file variables/global.tfvars \
|
--var-file variables/global.tfvars \
|
||||||
--var-file variables/${{github.event.inputs.environment}}.tfvars \
|
--var-file variables/${{github.event.inputs.environment}}.tfvars \
|
||||||
|
|
Loading…
Add table
Reference in a new issue