Loadbalancer Release 1.1.81 #81
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Project | |
on: | |
release: | |
types: [published] | |
jobs: | |
push_to_registries: | |
name: Push Docker image to the ghcr.io registry | |
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 | |
# 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)" |