don't excessively fail action
All checks were successful
Deploy Containers / Prepare (push) Successful in 4s
All checks were successful
Deploy Containers / Prepare (push) Successful in 4s
This commit is contained in:
26
.gitea/workflows/deploy-all.yml
Normal file
26
.gitea/workflows/deploy-all.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Deploy All Containers
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Prepare
|
||||
runs-on: runner
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
eval $(ssh-agent -s)
|
||||
ssh-add <(echo "${{ secrets.SSH_KEY }}")
|
||||
echo "HOST *" > ~/.ssh/config
|
||||
echo "${{ secrets.VAULT_PASS }}" > ~/.vault_pass.txt
|
||||
chmod 600 ansible.cfg
|
||||
/usr/bin/ansible-playbook main.yml --vault-password-file ~/.vault_pass.txt
|
||||
@@ -29,19 +29,13 @@ def run_deployment(tag = None):
|
||||
success = True
|
||||
for ind, line in enumerate(lines):
|
||||
if "fatal:" in line:
|
||||
success = False
|
||||
host = re.findall(bracket_regex, line)[0]
|
||||
task_failed = re.findall(bracket_regex, lines[ind - 1])[0]
|
||||
reason_failed = re.findall(quote_regex, line)
|
||||
|
||||
print("\n---------------------")
|
||||
print(" Deployment failed!")
|
||||
print(f" Task: {task_failed}")
|
||||
print(f" Host: {host}")
|
||||
print(f" Reason: {reason_failed}")
|
||||
print(line)
|
||||
print("---------------------\n")
|
||||
|
||||
sys.exit(1)
|
||||
print(f"\n{tag} failed deployment!\n{host}\n{reason_failed}\n{task_failed}\n")
|
||||
break
|
||||
|
||||
return success
|
||||
|
||||
|
||||
Reference in New Issue
Block a user