-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (33 loc) · 1.09 KB
/
docker-auto.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Publish all docker images
on:
workflow_dispatch:
schedule:
- cron: '26 5 * * *'
pull_request:
branches: [ main ]
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 "::set-output name=folders::$(ls -d */ | sed 's#/##g')"
- 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