# GitHub Actions workflow for updating Azure Architecture Icons
# This workflow can be run manually to update Azure icons

name: Update Azure Icons

on:
  workflow_dispatch:
    inputs:
      force_update:
        description: 'Force update even if icons exist'
        required: false
        default: 'false'
        type: boolean

jobs:
  update-icons:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Setup assets directory
        run: |
          chmod +x scripts/assets/*.sh
          ./scripts/assets/setup-assets.sh

      - name: Download Azure icons
        run: |
          ./scripts/assets/download-azure-icons.sh
        continue-on-error: true

      - name: Create stencil
        run: |
          ./scripts/assets/create-diagram-stencil.sh

      - name: Commit changes
        if: success()
        run: |
          git config --local user.email "action@github.com"
          git config --local user.name "GitHub Action"
          git add assets/
          git diff --staged --quiet || git commit -m "Update Azure Architecture Icons [skip ci]"
          git push
        continue-on-error: true

