Moving README generation into its own workflow.
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
|
with:
|
||||||
|
ref: 'main'
|
||||||
|
|
||||||
|
- name: Install yq
|
||||||
|
uses: dcarbone/install-yq-action@4075b4dca348d74bd83f2bf82d30f25d7c54539b # v1.3.1
|
||||||
|
|
||||||
|
- name: Generate service list
|
||||||
|
run: |
|
||||||
|
yq '.services | to_entries | map({"service": .key, "image": .value.image, "description": (.value.labels."homepage.description" // "")})' docker-compose.yml > services.yml
|
||||||
|
|
||||||
|
- name: Generate Markdown Table
|
||||||
|
uses: gazab/create-markdown-table@6686233d7008e8d8b9d4bbdbfd1fb1ae510019f0 # v1.0.7
|
||||||
|
id: service-table
|
||||||
|
with:
|
||||||
|
file: ./services.yml
|
||||||
|
|
||||||
|
- name: Regenerate README
|
||||||
|
run: |
|
||||||
|
echo "# List of Services" > README.md
|
||||||
|
echo -e "\n\n" >> README.md
|
||||||
|
echo "${{ steps.service-table.outputs.table }}" >> README.md
|
||||||
|
|
||||||
|
- name: Add/Commit README.md
|
||||||
|
id: commit-readme
|
||||||
|
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
|
||||||
|
with:
|
||||||
|
message: "chore: Update README"
|
||||||
|
add: "README.md"
|
||||||
@@ -257,56 +257,6 @@ jobs:
|
|||||||
notification_title: "GITEA: Cloudflare Setup @ Rinoa"
|
notification_title: "GITEA: Cloudflare Setup @ Rinoa"
|
||||||
notification_message: "Cloudflare DNS setup completed successfully."
|
notification_message: "Cloudflare DNS setup completed successfully."
|
||||||
|
|
||||||
regenerate-readme-modified-services:
|
|
||||||
name: Update README & Generate List of Modified Services
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [cloudflare-dns-setup]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
|
||||||
|
|
||||||
- name: Install yq
|
|
||||||
uses: dcarbone/install-yq-action@4075b4dca348d74bd83f2bf82d30f25d7c54539b # v1.3.1
|
|
||||||
|
|
||||||
- name: Gotify Notification
|
|
||||||
uses: eikendev/gotify-action@master
|
|
||||||
with:
|
|
||||||
gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
|
|
||||||
gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
|
|
||||||
notification_title: "GITEA: README Update"
|
|
||||||
notification_message: "Updating README..."
|
|
||||||
|
|
||||||
- name: Generate service list
|
|
||||||
run: |
|
|
||||||
yq '.services | to_entries | map({"service": .key, "image": .value.image, "description": (.value.labels."homepage.description" // "")})' docker-compose.yml > services.yml
|
|
||||||
|
|
||||||
- name: Generate Markdown Table
|
|
||||||
uses: gazab/create-markdown-table@6686233d7008e8d8b9d4bbdbfd1fb1ae510019f0 # v1.0.7
|
|
||||||
id: service-table
|
|
||||||
with:
|
|
||||||
file: ./services.yml
|
|
||||||
|
|
||||||
- name: Regenerate README
|
|
||||||
run: |
|
|
||||||
echo "# List of Services" > README.md
|
|
||||||
echo -e "\n\n" >> README.md
|
|
||||||
echo "${{ steps.service-table.outputs.table }}" >> README.md
|
|
||||||
|
|
||||||
- name: Add/Commit README.md
|
|
||||||
id: commit-readme
|
|
||||||
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
|
|
||||||
with:
|
|
||||||
message: "chore: Update README"
|
|
||||||
add: "README.md"
|
|
||||||
|
|
||||||
- name: Gotify Notification
|
|
||||||
uses: eikendev/gotify-action@master
|
|
||||||
with:
|
|
||||||
gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
|
|
||||||
gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
|
|
||||||
notification_title: "GITEA: README Update"
|
|
||||||
notification_message: "README updated"
|
|
||||||
|
|
||||||
pr-merge:
|
pr-merge:
|
||||||
name: PR Merge
|
name: PR Merge
|
||||||
needs: [regenerate-readme-modified-services]
|
needs: [regenerate-readme-modified-services]
|
||||||
|
|||||||
@@ -26,31 +26,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0 # required so we can access main^1
|
fetch-depth: 0 # required so we can access main^1
|
||||||
|
|
||||||
- name: Generate service list for README
|
|
||||||
run: |
|
|
||||||
yq '.services | to_entries | map({"service": .key, "image": .value.image, "description": (.value.labels."homepage.description" // "")})' docker-compose.yml > services.yml
|
|
||||||
|
|
||||||
- name: Generate Markdown Table
|
|
||||||
uses: gazab/create-markdown-table@6686233d7008e8d8b9d4bbdbfd1fb1ae510019f0 # v1.0.7
|
|
||||||
id: service-table
|
|
||||||
with:
|
|
||||||
file: ./services.yml
|
|
||||||
|
|
||||||
- name: Regenerate README
|
|
||||||
run: |
|
|
||||||
echo "# List of Services" > README.md
|
|
||||||
echo -e "\n\n" >> README.md
|
|
||||||
echo "${{ steps.service-table.outputs.table }}" >> README.md
|
|
||||||
|
|
||||||
- name: Add, Commit, & Push README.md
|
|
||||||
id: commit-readme
|
|
||||||
uses: actions4git/add-commit-push@v1.0.0
|
|
||||||
with:
|
|
||||||
path: .
|
|
||||||
add-pathspec: "README.md"
|
|
||||||
commit-author: me
|
|
||||||
commit-message: "chore: Update README"
|
|
||||||
|
|
||||||
- name: Save docker-compose.yml before merge (old)
|
- name: Save docker-compose.yml before merge (old)
|
||||||
run: |
|
run: |
|
||||||
git fetch origin main
|
git fetch origin main
|
||||||
|
|||||||
Reference in New Issue
Block a user