added actions for docker installation #10
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: Destroy infrastracture | |
on: workflow_dispatch | |
jobs: | |
deploy: | |
runs-on: cicd1 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Remove Apache | |
uses: ansible -i aws_ec2.yml -all -m apt -a "name=apache2 status=absent" | |
- name: Terraform init | |
run: terraform init | |
- name: Create a tfvars file | |
run: | | |
echo "cf_email=\"${{ secrets.CF_EMAIL }}\"" > my_variables.tfvars | |
echo "cf_api=\"${{ secrets.CF_API }}\"" >> my_variables.tfvars | |
echo "zonecf_id=\"${{ secrets.ZONECF_ID }}\"" >> my_variables.tfvars | |
echo "pub_key=\"${{ secrets.PUB_KEY }}\"" >> my_variables.tfvars | |
# On push to "main", build or change infrastructure according to Terraform configuration files | |
# Note: It is recommended to set up a required "strict" status check in your repository for "Terraform Cloud". See the documentation on "strict" required status checks for more information: https://help.github.com/en/github/administering-a-repository/types-of-required-status-checks | |
- name: Terraform Destroy | |
run: terraform destroy -auto-approve -input=false -var-file=my_variables.tfvars |