name: List of Services README Generation on: schedule: - cron: 30 */2 * * * workflow_dispatch: jobs: readme-services: name: Generate Services List runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: ref: main - name: Install dependencies for ansi-to-html uses: bahmutov/npm-install@v1 with: working-directory: ./path/to/actions-ansi-to-html useLockFile: true install-command: npm ci --silent - name: Generate system info (ANSI preserved) id: gen-sysinfo uses: appleboy/ssh-action@v1.2.3 with: host: 192.168.1.254 username: charish port: 22 key: ${{ secrets.RUNNER_SSH_PRIVATE_KEY }} capture_stdout: true script: neofetch - name: Convert ANSI to HTML id: ansi-to-html uses: https://git.trez.wtf/Trez/actions-ansi-to-html@main with: input: ${{ steps.gen-sysinfo.outputs.stdout }} # run: | # echo "${{ steps.gen-sysinfo.outputs.stdout }}" > sysinfo.ansi # cat sysinfo.ansi | aha --black > sysinfo.html - name: Generate service list run: | yq 'explode(.) | .services | to_entries | map({"service": .key, "image": (.value.image | sub("@sha256:.*$"; "")), "description": (.value.labels."homepage.description" // "")})' docker-compose.yml > services.yml - name: Generate Markdown Table uses: gazab/create-markdown-table@v1.0.7 id: service-table with: file: ./services.yml - name: Regenerate README (theme-adaptive) run: | { echo "# System Info" echo "" echo '
View Neofetch Output' echo '
' echo '' echo "${{ steps.ansi-to-html.outputs.contents }}" echo '
' echo '
' echo "" echo "# List of Services" echo "" echo "${{ steps.service-table.outputs.table }}" } > README.md - name: Add/Commit README.md uses: EndBug/add-and-commit@v9 with: message: "chore: Update README" add: "README.md"