Joplin proxmox configs
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 1m31s
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 1m31s
This commit is contained in:
17
.github/workflows/infra.yaml
vendored
17
.github/workflows/infra.yaml
vendored
@@ -4,7 +4,7 @@ on:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- infra/**-playbook.yaml
|
||||
- infra/**playbook.yaml
|
||||
- .github/workflows/infra.yaml
|
||||
push:
|
||||
branches:
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
|
||||
- name: Check playbooks
|
||||
run: |
|
||||
for file in $(find . -wholename "*/infra/*-playbook.yaml" -type f); do
|
||||
for file in $(find . -wholename "*/infra/*playbook.yaml" -type f); do
|
||||
ansible-playbook --inventory ./inventory --check "$file"
|
||||
done
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
if: env.DEPLOY == 'some'
|
||||
uses: tj-actions/changed-files@v38
|
||||
with:
|
||||
files: infra/**/*-playbook.yaml
|
||||
files: infra/**/*playbook.yaml
|
||||
|
||||
- name: Get playbooks
|
||||
id: playbooks
|
||||
@@ -53,12 +53,20 @@ jobs:
|
||||
if [[ "${{ env.DEPLOY }}" == "some" ]]; then
|
||||
export TO_RUN="${{ steps.files.outputs.all_changed_files }}"
|
||||
else
|
||||
export TO_RUN="$(find . -wholename './infra/*-playbook.yaml' -type f)"
|
||||
export TO_RUN="$(find . -wholename './infra/*playbook.yaml' -type f)"
|
||||
fi
|
||||
export TO_RUN="$( echo -n $TO_RUN | tr ' ' '\n' | sort | tr '\n' ' ' )" # run things in order :)
|
||||
echo "will run playbooks: $TO_RUN"
|
||||
echo "to_run=$TO_RUN" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Setup environment
|
||||
if: env.DEPLOY != 'none' && steps.playbooks.outputs.to_run != ''
|
||||
run: |
|
||||
mkdir ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
echo "${{ secrets.SSH_PRIVATE }}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
|
||||
- name: Run playbooks
|
||||
if: env.DEPLOY != 'none' && steps.playbooks.outputs.to_run != ''
|
||||
env:
|
||||
@@ -66,4 +74,5 @@ jobs:
|
||||
PROXMOX_USER: ${{ secrets.PROXMOX_USER }}
|
||||
PROXMOX_TOKEN_ID: ${{ secrets.PROXMOX_TOKEN_ID }}
|
||||
PROXMOX_TOKEN_SECRET: ${{ secrets.PROXMOX_TOKEN_SECRET }}
|
||||
SSH_PUBLIC: ${{ secrets.SSH_PUBLIC }}
|
||||
run: ansible-playbook --inventory ./inventory ${{ steps.playbooks.outputs.to_run }}
|
||||
|
Reference in New Issue
Block a user