Skip to content

Generate Cookbook Portainer Data #15

Generate Cookbook Portainer Data

Generate Cookbook Portainer Data #15

Workflow file for this run

name: Generate Cookbook Portainer Data
on:
push:
branches:
- main
paths:
- 'cookbook/**/info.yaml'
- 'cookbook/**'
workflow_dispatch:
inputs:
forceRun:
description: 'Force Run Option'
required: true
default: 'false'
type: choice
options:
- 'true'
- 'false'
jobs:
run:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: 📂 Checkout code v4
uses: actions/checkout@v4
- name: 🐳 Setup Docker
uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: '2.14.2'
- name: ⚠️ Check docker-compose files and syntax
run: bash tools/test_docker_compose.sh
- name: ⚙️ Setup Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: 📦 Install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: 💻 Run Python Portainer Collection Downloader
run: python tools/baker_download_collection.py
- name: 💻 Run Python Portainer Generator
run: python tools/baker_portainer_repo.py
- name: 🔧 set git config
env:
GH_TOKEN: ${{ github.token }}
run: |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)"
git config -l
- name: 💾 Commit and push new files JSON templates
run: |
git add templates_cookbook.json
git add templates.json
git commit -m "Generated new files $(date +'%Y-%m-%d %H:%M:%S')"
git push -u origin main
- name: All done ✅
run: echo "DONE $(date +'%Y-%m-%d %H:%M:%S')"