Update README.template.md #4
This file contains hidden or 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: Update README with docker-compose.yml | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docker-compose.yml' | |
| - '.github/workflows/template/README.template.md' | |
| jobs: | |
| update-readme: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Generate README from template | |
| run: | | |
| export DOCKER_COMPOSE=$(cat docker-compose.yml) | |
| envsubst < .github/workflows/template/README.template.md > README.md | |
| - name: Check if there are changes | |
| id: verify-changed-files | |
| run: | | |
| if git diff --quiet; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push changes | |
| if: steps.verify-changed-files.outputs.changed == 'true' | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add README.md | |
| git commit -m "docs: update README with docker-compose.yml contents" | |
| git push |