ci/cd on push test
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 1m31s

This commit is contained in:
CC
2026-05-21 17:03:36 +01:00
parent 31cc759d4d
commit 5e4d5c82d8

View File

@@ -23,11 +23,12 @@ jobs:
- name: Check files & Select tfvars
shell: bash
run: |
pwd
mkdir -p ansible/inventory
rm ansible/inventory/inventory.yml
cd terraform
rm vm_data.yml
cp "${{ inputs.tfvars_file || 'single.tfvars.example' }}" terraform.tfvars
ls
- uses: hashicorp/setup-terraform@v4
@@ -42,20 +43,6 @@ jobs:
run: terraform apply -auto-approve
working-directory: "terraform"
- name: Configure Git
run: |
git config user.name "git-bot"
git config user.email "got-bot@text.com"
- name: Commit and push to Gitea
run: |
git remote set-url origin https://$GITEA_USERNAME:${{ secrets.GIT_BOT_TOKEN }}@tea.charcarservices.uk/CC/N8N.git
git add terraform/vm_data.yml ansible/inventory/inventory.yml
git diff --cached --quiet || git commit -m "chore: update terraform outputs"
git push origin HEAD:main
env:
GITEA_USERNAME: git-bot # or your bot account
- name: Install Ansible
shell: bash
run: |
@@ -69,12 +56,24 @@ jobs:
chmod 600 ~/.ssh/id_rsa
echo -e "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile=/dev/null\n" > ~/.ssh/config
- name: Setup Ansible Directories
- name: Ansible Inventory YML
run: |
pwd
cat ansible/inventory/inventory.yml
ls -r
- name: Run playbook
run: |
ansible-playbook ansible/playbooks/docker_copy.yml -i ansible/inventory/inventory.yml -u cloud --private-key ~/.ssh/id_rsa
- name: Configure Git
run: |
git config user.name "git-bot"
git config user.email "got-bot@text.com"
- name: Commit and push to Gitea
run: |
git remote set-url origin https://$GITEA_USERNAME:${{ secrets.GIT_BOT_TOKEN }}@tea.charcarservices.uk/CC/N8N.git
git add terraform/vm_data.yml ansible/inventory/inventory.yml
git diff --cached --quiet || git commit -m "chore: update terraform outputs"
git push origin HEAD:main
env:
GITEA_USERNAME: git-bot # or your bot account