Publish all docker images #325
This file contains 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: Publish all docker images | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '26 5 * * *' | |
push: | |
branches: [ main ] | |
jobs: | |
trigger-workflow: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: List folders | |
id: list-folders | |
run: | | |
echo "folders=$(ls -d */ | sed 's#/##g' | paste -sd ',')" >> $GITHUB_OUTPUT | |
- name: Trigger Docker Publish Workflow for each folder | |
run: | | |
IFS=', ' read -r -a folders <<< "${{ steps.list-folders.outputs.folders }}" | |
for folder in "${folders[@]}"; do | |
echo "Triggering Docker Publish Workflow for folder: $folder" | |
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
https://api.github.com/repos/${{ github.repository }}/actions/workflows/docker-publish.yml/dispatches \ | |
-d '{"ref":"main", "inputs":{"version":"'$folder'"}}' | |
done |