Skip to content

feat(deployment): provision scaleway with tf #41

feat(deployment): provision scaleway with tf

feat(deployment): provision scaleway with tf #41

Workflow file for this run

name: deployment
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
jobs:
provision:
runs-on: ubuntu-20.04
environment: staging
defaults:
run:
working-directory: deployment
outputs:
encrypted_tf_outputs: ${{ steps.tf-output.outputs.encrypted_tf_outputs }}
container:
image: hashicorp/terraform:1.4.0
env:
TF_IN_AUTOMATION: true
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# `TF_VAR_*` are case sensitive and must match the case of variables
TF_VAR_datawarehouse_admin_password: ${{ secrets.DATAWAREHOUSE_ADMIN_PASSWORD }}
TF_VAR_datawarehouse_admin_username: ${{ vars.DATAWAREHOUSE_ADMIN_USERNAME }}
TF_VAR_datawarehouse_di_database: ${{ vars.DATAWAREHOUSE_DI_DATABASE }}
TF_VAR_datawarehouse_di_password: ${{ secrets.DATAWAREHOUSE_DI_PASSWORD }}
TF_VAR_datawarehouse_di_username: ${{ vars.DATAWAREHOUSE_DI_USERNAME }}
TF_VAR_scaleway_access_key: ${{ secrets.SCALEWAY_ACCESS_KEY }}
TF_VAR_scaleway_project_id: ${{ vars.SCALEWAY_PROJECT_ID }}
TF_VAR_scaleway_secret_key: ${{ secrets.SCALEWAY_SECRET_KEY }}
TF_VAR_environment_name: ${{ vars.ENVIRONMENT_NAME }}
TF_VAR_airflow_admin_password: ${{ secrets.AIRFLOW_ADMIN_PASSWORD }}
ENV: ${{ vars.TF_VAR_ENVIRONMENT_NAME }}
volumes:
- .:/deployment
options: --workdir /deployment
steps:
- uses: actions/checkout@v3
- name: tf init
run: |
terraform -chdir="environments/${ENV}" init \
-backend-config "bucket=data-inclusion-terraform" \
-backend-config "key=stack_data/${ENV}" \
-backend-config "region=fr-par" \
-backend-config "endpoint=https://s3.fr-par.scw.cloud"
- name: tf validate
run: |
terraform -chdir="environments/${ENV}" validate
- name: tf plan
run: |
terraform -chdir="environments/${ENV}" plan
- name: tf apply
run: |
terraform -chdir="environments/${ENV}" apply -auto-approve