From 6fda7f7d3e91863f913e1ce078fc72b2a788426a Mon Sep 17 00:00:00 2001 From: Ugur Aslan Date: Fri, 15 Nov 2024 17:37:55 +0100 Subject: [PATCH 1/2] implemented auto web site update action for updating docs --- .github/workflows/deploy-docs.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/deploy-docs.yml diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 00000000..fd954ad4 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,18 @@ +name: Trigger Website Docs Update +on: + push: + branches: [ master ] +jobs: + trigger: + runs-on: ubuntu-latest + steps: + - name: Trigger Deployment + run: | + response=$(curl -X POST -w "%{http_code}" -s -o /dev/null ${{ secrets.WEBSITE_DEPLOY_URL }}) + if [ "$response" -eq 200 ]; then + echo "Deployment triggered successfully" + exit 0 + else + echo "Failed to trigger deployment. Status code: $response" + exit 1 + fi From 1e831f3fde16eac93792492180d10e4ae297a7af Mon Sep 17 00:00:00 2001 From: Ugur Aslan Date: Tue, 19 Nov 2024 12:25:26 +0100 Subject: [PATCH 2/2] checking if docs are modified when a PR merged to the master branch --- .github/workflows/deploy-docs.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index fd954ad4..ee30f927 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -6,7 +6,17 @@ jobs: trigger: runs-on: ubuntu-latest steps: + - name: Check for changes in docs folder + id: check_docs_changes + run: | + if git diff --name-only HEAD^ HEAD | grep -q '^docs/'; then + echo "docs_changed=true" >> $GITHUB_ENV + else + echo "docs_changed=false" >> $GITHUB_ENV + fi + - name: Trigger Deployment + if: env.docs_changed == 'true' run: | response=$(curl -X POST -w "%{http_code}" -s -o /dev/null ${{ secrets.WEBSITE_DEPLOY_URL }}) if [ "$response" -eq 200 ]; then