Skip to content

Loadbalancer Release v1.1.85 #85

Loadbalancer Release v1.1.85

Loadbalancer Release v1.1.85 #85

Workflow file for this run

name: Deploy Project
on:
release:
types: [published]
jobs:
push_to_registries:
name: Run Apache Load Balancer
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:
# Step 1: Check out the repository
- name: Checkout repository
uses: actions/checkout@v3
# Step 2: Set up Terraform
- name: Set up Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.5.6 # Replace with your required version
# Step 4: Install Ansible
- name: Install Ansible
run: |
sudo apt update
sudo apt install -y ansible
- name: Install jq
run: sudo apt install -y jq
- name: Write SSH Private Key
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
echo "$SSH_PRIVATE_KEY" > id_ecdsa
chmod 600 id_ecdsa
cat id_ecdsa
- name: Write SSH Public Key
env:
SSH_PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }}
run: |
echo "$SSH_PUBLIC_KEY" > id_ecdsa.pub
chmod 600 id_ecdsa.pub
- name: Fix provider permissions
run: chmod -R +x .terraform/providers
# Step 5: Initialize Terraform
- name: Initialize Terraform
run: terraform init
# Step 6: Plan Terraform deployment
- name: Plan Terraform
run: terraform plan
# Step 7: Apply Terraform configuration
- name: Apply Terraform
run: terraform apply -auto-approve
# Step 12: Run Ansible playbook
- name: Run Ansible Playbook
run: ansible-playbook -i ansible/inventory ansible/playbook.yml -e "backend_ips=$(terraform output -json backend_ips)"