feat(container): update image ghcr.io/n8n-io/n8n ( 2.22.3 → 2.23.1 ) #819
This file contains hidden or 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: Docker CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "docker/**" | |
| workflow_dispatch: | |
| inputs: | |
| folder: | |
| description: "Folder to deploy (ex. jellyfin, blocky, geohub)" | |
| required: true | |
| type: string | |
| jobs: | |
| deploy: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Pre-clean workspace directory | |
| run: | | |
| echo "Cleaning workspace at ${{ github.workspace }}" | |
| sudo chown -R $USER:$USER "${GITHUB_WORKSPACE}" | |
| sudo rm -rf "${GITHUB_WORKSPACE:?}/*" | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set Git safe directory | |
| run: git config --global --add safe.directory /__w/iac/iac | |
| - name: Fetch all history for git diff | |
| run: git fetch --depth=2 | |
| - name: Detect modified folders | |
| id: detect-changes | |
| run: | | |
| if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then | |
| git fetch --unshallow | |
| fi | |
| folders=$(git diff --name-only HEAD~1 HEAD | grep '^docker/' | cut -d/ -f2 | sort | uniq) | |
| echo "Modified folders: $folders" | |
| echo "::set-output name=folders::$folders" | |
| - name: Override Folder (Manual Run) | |
| if: github.event_name == 'workflow_dispatch' | |
| run: | | |
| echo "folder=${{ github.event.inputs.folder }}" >> $GITHUB_ENV | |
| - name: Map Folder to Host | |
| shell: bash | |
| run: | | |
| if [ -n "${folder}" ]; then | |
| folder_list="${folder}" | |
| else | |
| folder_list="${{ steps.detect-changes.outputs.folders }}" | |
| fi | |
| IFS=' ' read -r -a folder_array <<< "$folder_list" | |
| hosts="" | |
| folders="" | |
| for f in "${folder_array[@]}"; do | |
| case $f in | |
| ai) host="ollama" ;; | |
| audiobookshelf) host="audiobook-shelf" ;; | |
| blocky) host="blocky-HA" ;; | |
| caddy) host="proxy" ;; | |
| couchdb) host="docker" ;; | |
| downloaders) host="truenas" ;; | |
| exporters) host="Ubu" ;; | |
| geohub) host="Ubu" ;; | |
| jellyfin) host="truenas" ;; | |
| npm) host="Nginx-Proxy-Manager" ;; | |
| omni) host="omni" ;; | |
| vps) host="racknerd-vps" ;; | |
| wazuh) host="wazuh" ;; | |
| *) echo "Unknown folder: $f" && exit 1 ;; | |
| esac | |
| if [ -z "$hosts" ]; then | |
| hosts="$host" | |
| folders="$f" | |
| else | |
| hosts="$hosts,$host" | |
| folders="$folders,$f" | |
| fi | |
| done | |
| echo "Deploying to hosts: $hosts for folders: $folders" | |
| echo "target_host=$hosts" >> $GITHUB_ENV | |
| echo "folder=$folders" >> $GITHUB_ENV | |
| - name: Set up SSH agent | |
| run: | | |
| eval $(ssh-agent -s) | |
| ssh-add ~/.ssh/id_rsa | |
| - name: Run Ansible Playbook | |
| env: | |
| BWS_ACCESS_TOKEN: ${{ secrets.BWS_ACCESS_TOKEN }} | |
| ANSIBLE_CONFIG: ansible/ansible.cfg | |
| run: | | |
| set -e | |
| ansible-playbook \ | |
| -i ansible/inventories/netbox/netbox.inventory.yml \ | |
| -i ansible/inventories/oracle/inventory.oci.yml \ | |
| -i ansible/inventories/proxmox/inventory.proxmox.yml \ | |
| ./ansible/playbooks/deploy-docker.yml \ | |
| --extra-vars "target_host=${target_host} folder=${folder}" \ | |
| | tee ansible_output.txt | |
| if grep -q 'unreachable=1\|failed=[1-9]' ansible_output.txt; then | |
| echo "Ansible reported failures or unreachable hosts." | |
| exit 1 | |
| fi |