Deploy infrastracture #45
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 infrastracture | |
on: workflow_dispatch | |
jobs: | |
deploy: | |
runs-on: cicd1 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Terraform Init | |
run: terraform init | |
# 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 Apply | |
run: terraform apply -auto-approve -input=false | |
- name: Delay for 7s | |
run: sleep 7s | |
- name: Run Ansible Playbook | |
run: ansible-playbook -i aws_ec2.yml playbook.yml -e "docker_key=${{ secrets.DOCKER_KEY }}" | |
... |