Procházet zdrojové kódy

ci: trigger update-emqx-docs workflow directly on tag push

Ivan Dyachkov před 1 rokem
rodič
revize
03dab9ed38

+ 0 - 22
.github/workflows/_push-entrypoint.yaml

@@ -204,28 +204,6 @@ jobs:
         run: |
           gh --repo emqx/emqx-i18n workflow run sync-en-doc.yaml -f version=${GITHUB_REF_NAME##[v|e]} -f repository=${GITHUB_REPOSITORY} -f run_id=${GITHUB_RUN_ID}
 
-  update_emqx_docs:
-    if: needs.prepare.outputs.release == 'true'
-    needs:
-      - prepare
-      - compile
-      - build_and_push_docker_images
-    runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
-    steps:
-      - name: Generate GitHub App token
-        id: app-token
-        uses: actions/create-github-app-token@v1
-        with:
-          app-id: ${{ vars.AUTH_APP_ID }}
-          private-key: ${{ secrets.AUTH_APP_PRIVATE_KEY }}
-          owner: ${{ github.repository_owner }}
-
-      - name: Create PR in emqx/emqx-docs
-        env:
-          GH_TOKEN: ${{ steps.app-token.outputs.token }}
-        run: |
-          gh --repo emqx/emqx-docs workflow run update-api-and-cfg-manual.yaml -f version=${GITHUB_REF_NAME##[v|e]} -f repository=${GITHUB_REPOSITORY} -f run_id=${GITHUB_RUN_ID}
-
   run_emqx_app_tests:
     if: needs.prepare.outputs.release != 'true'
     needs:

+ 5 - 10
.github/workflows/update-emqx-docs.yaml

@@ -1,13 +1,8 @@
 name: Update emqx/emqx-docs
 on:
-  workflow_call:
-    inputs:
-      tag:
-        required: true
-        type: string
-    secrets:
-      AUTH_APP_PRIVATE_KEY:
-        required: true
+  push:
+    tags:
+      - 'v*'
   workflow_dispatch:
     inputs:
       tag:
@@ -21,7 +16,7 @@ jobs:
   update_emqx_docs:
     runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
     env:
-      TAG: ${{ github.event.inputs.tag }}
+      TAG: ${{ github.event_name == 'push' && github.ref_name || github.event.inputs.tag }}
     steps:
       - name: Generate GitHub App token
         id: app-token
@@ -39,7 +34,7 @@ jobs:
 
       - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
         with:
-          ref: ${{ github.event.inputs.tag }}
+          ref: ${{ env.TAG }}
           fetch-depth: 0
 
       - name: Detect emqx profile