mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +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:
|
||||
deploy:
|
||||
Deploy shared terraform stack:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup AWS credentials file
|
||||
run: |
|
||||
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
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4
|
||||
with:
|
||||
terraform_version: 1.5.2
|
||||
|
||||
- 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-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}"
|
||||
aws-secret-access-key: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}"
|
||||
aws-region: eu-west-2
|
||||
env:
|
||||
AWS_PROFILE: "DevAdmin"
|
||||
|
||||
# Deploy shared terrform things
|
||||
- name: Setup Terraform
|
||||
shell: bash
|
||||
uses: hashicorp/setup-terraform@v3
|
||||
|
||||
- name: Terraform Init
|
||||
run: cd infrastructure/terraform/shared && terraform init
|
||||
working-directory: ./infrastructure/terraform/shared
|
||||
shell: bash
|
||||
run: terraform init -reconfigure
|
||||
|
||||
- name: Terraform Workspace
|
||||
run: |
|
||||
cd infrastructure/terraform/shared
|
||||
terraform workspace select dev || terraform workspace new dev
|
||||
working-directory: ./infrastructure/terraform/shared
|
||||
shell: bash
|
||||
run: terraform workspace select dev || terraform workspace new dev
|
||||
|
||||
- name: Terraform Plan (shared)
|
||||
run: |
|
||||
cd infrastructure/terraform/shared
|
||||
terraform plan -var-file=dev.tfvars
|
||||
working-directory: ./infrastructure/terraform/shared
|
||||
shell: bash
|
||||
run: terraform plan -var-file=dev.tfvars -out=tfplan
|
||||
|
||||
# only run once
|
||||
- name: Terraform Apply (shared)
|
||||
run: |
|
||||
cd infrastructure/terraform/shared
|
||||
terraform apply -auto-approve -var-file=dev.tfvars
|
||||
# - name: Terraform Apply
|
||||
# working-directory: ./infrastructure/terraform/shared
|
||||
# shell: bash
|
||||
# run: terraform apply -auto-approve tfplan
|
||||
|
||||
|
||||
|
||||
# # 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