mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
check new layout
This commit is contained in:
parent
e069f5d129
commit
a4124dce33
5 changed files with 40 additions and 41 deletions
81
.github/workflows/deploy_terraform.yml
vendored
81
.github/workflows/deploy_terraform.yml
vendored
|
|
@ -6,61 +6,60 @@ on:
|
||||||
- "**"
|
- "**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
Deploy shared terraform stack:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup AWS credentials file
|
- name: Configure AWS credentials
|
||||||
run: |
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
mkdir -p ~/.aws
|
|
||||||
echo "[DevAdmin]" > ~/.aws/credentials
|
|
||||||
echo "aws_access_key_id = ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials
|
|
||||||
echo "aws_secret_access_key = ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials
|
|
||||||
echo "[ProdAdmin]" >> ~/.aws/credentials
|
|
||||||
echo "aws_access_key_id = ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials
|
|
||||||
echo "aws_secret_access_key = ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials
|
|
||||||
|
|
||||||
- name: Setup AWS config file
|
|
||||||
run: |
|
|
||||||
echo "[profile DevAdmin]" > ~/.aws/config
|
|
||||||
echo "region = eu-west-2" >> ~/.aws/config
|
|
||||||
echo "[profile ProdAdmin]" >> ~/.aws/config
|
|
||||||
echo "region = eu-west-2" >> ~/.aws/config
|
|
||||||
|
|
||||||
- name: Setup Terraform
|
|
||||||
uses: hashicorp/setup-terraform@v1
|
|
||||||
with:
|
with:
|
||||||
terraform_version: 1.5.2
|
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}"
|
||||||
|
aws-secret-access-key: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}"
|
||||||
- name: Configure AWS credentials (DevAdmin)
|
|
||||||
uses: aws-actions/configure-aws-credentials@v1
|
|
||||||
with:
|
|
||||||
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
|
|
||||||
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
|
|
||||||
aws-region: eu-west-2
|
aws-region: eu-west-2
|
||||||
env:
|
env:
|
||||||
AWS_PROFILE: "DevAdmin"
|
AWS_PROFILE: "DevAdmin"
|
||||||
|
|
||||||
# Deploy shared terrform things
|
- name: Setup Terraform
|
||||||
|
shell: bash
|
||||||
|
uses: hashicorp/setup-terraform@v3
|
||||||
|
|
||||||
- name: Terraform Init
|
- name: Terraform Init
|
||||||
run: cd infrastructure/terraform/shared && terraform init
|
working-directory: ./infrastructure/terraform/shared
|
||||||
|
shell: bash
|
||||||
|
run: terraform init -reconfigure
|
||||||
|
|
||||||
- name: Terraform Workspace
|
- name: Terraform Workspace
|
||||||
run: |
|
working-directory: ./infrastructure/terraform/shared
|
||||||
cd infrastructure/terraform/shared
|
shell: bash
|
||||||
terraform workspace select dev || terraform workspace new dev
|
run: terraform workspace select dev || terraform workspace new dev
|
||||||
|
|
||||||
- name: Terraform Plan (shared)
|
- name: Terraform Plan (shared)
|
||||||
run: |
|
working-directory: ./infrastructure/terraform/shared
|
||||||
cd infrastructure/terraform/shared
|
shell: bash
|
||||||
terraform plan -var-file=dev.tfvars
|
run: terraform plan -var-file=dev.tfvars -out=tfplan
|
||||||
|
|
||||||
# only run once
|
# - name: Terraform Apply
|
||||||
- name: Terraform Apply (shared)
|
# working-directory: ./infrastructure/terraform/shared
|
||||||
run: |
|
# shell: bash
|
||||||
cd infrastructure/terraform/shared
|
# run: terraform apply -auto-approve tfplan
|
||||||
terraform apply -auto-approve -var-file=dev.tfvars
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# # apply shared dev
|
||||||
|
# - name: Terraform Apply (shared)
|
||||||
|
# run: |
|
||||||
|
# cd infrastructure/terraform/shared
|
||||||
|
# terraform apply -auto-approve -var-file=dev.tfvars
|
||||||
|
|
||||||
|
# - name: Build & push image
|
||||||
|
# run: |
|
||||||
|
# IMAGE_TAG=address2uprn-${GITHUB_SHA}
|
||||||
|
# IMAGE_URI=${AWS_ACCOUNT_ID}.dkr.ecr.eu-west-2.amazonaws.com/lambda-shared-dev:${IMAGE_TAG}
|
||||||
|
|
||||||
|
# docker build -t $IMAGE_URI .
|
||||||
|
# docker push $IMAGE_URI
|
||||||
|
|
||||||
|
# echo "IMAGE_URI=$IMAGE_URI" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue