Skip to content

Add new workflow for detecting changes in dot org #1

Add new workflow for detecting changes in dot org

Add new workflow for detecting changes in dot org #1

name: Detect changes in documentation within nginx/nginx.org
on:
pull_request:
# workflow_dispatch:
# schedule:
# - cron: "0 */23 * * *"
jobs:
detect-changes:
name: Detect changes in 'en' docs of nginx/nginx.org
runs-on: ubuntu-latest
outputs:
IS_CHANGES_DETECTED: ${{ steps.check_changes.outputs.changed }}
steps:
- name: Clone the nginx/nginx-org repository
run: |
git clone --depth=2 https://github.com/nginx/nginx.org.git dot-org-repo
- name: Change for changes in xml/en folder
id: check_changes
run: |
cd dot-org-repo
commit1=$(git rev-parse HEAD)
commit2=$(git rev-parse HEAD^)
changed=false
if git diff --name-only $commit2 $commit1 | grep '^en/'; then
echo "Changes detected in /en"
changed=true
else
echo "No changes in /en"
fi
echo "changed" >> $GITHUB_OUTPUT
execute-make:
name: Execute make target 'make hugo-md'
if: needs.detect-changes.outputs.IS_CHANGES_DETECTED
needs: detect-changes
runs-on: ubuntu-latest
steps:
- name: PLACEHOLDER
run: |
echo "PLACEHOLDER"
move-generated-files:
name: Move generated markdown files to '/content/nginx' directory
if: needs.detect-changes.outputs.IS_CHANGES_DETECTED
needs: execute-make
runs-on: ubuntu-latest
steps:
- name: PLACEHOLDER
run: |
echo "PLACEHOLDER"
create-PR:
name: Create PR in documentation repository
if: needs.detect-changes.outputs.IS_CHANGES_DETECTED
needs: move-generated-files
runs-on: ubuntu-latest
steps:
- name: PLACEHOLDER
run: |
echo "PLACEHOLDER"