This is an automated email from the ASF dual-hosted git repository.

jin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-doc.git

commit b70115d92031fb60b60b4006c9b8ea05133551b5
Author: imbajin <[email protected]>
AuthorDate: Wed Sep 14 16:46:36 2022 +0800

    refactor steps
---
 .github/workflows/hugo.yml | 54 ++++++++++++++++------------------------------
 1 file changed, 18 insertions(+), 36 deletions(-)

diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml
index 52af7bec..d9451f2a 100644
--- a/.github/workflows/hugo.yml
+++ b/.github/workflows/hugo.yml
@@ -14,39 +14,24 @@
 # limitations under the License.
 
 # Sample workflow for building and deploying a Hugo site to GitHub Pages
-name: Deploy Hugo site to Pages
+# Refer: https://github.com/marketplace/actions/github-pages-action
+name: Deploy site to pages (hugo)
 
 on:
-  # Runs on pushes targeting the default branch
   pull_request:
   push:
-    branches: ["master"]
-
-  # Allows you to run this workflow manually from the Actions tab
-  # workflow_dispatch:
-
-# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
-permissions:
-  contents: write # old: read
-  pages: write
-  id-token: write
-
-# Allow one concurrent deployment
-concurrency:
-  group: "pages"
-  cancel-in-progress: true
-
-# Default to bash
-defaults:
-  run:
-    shell: bash
+    branches: ["master"] # Set a branch name to trigger deployment
 
 jobs:
-  # Build job
-  build:
+  deploy:
     runs-on: ubuntu-latest
-    env:
-      HUGO_VERSION: 0.102.3
+    permissions:
+      contents: write
+      pages: write
+      id-token: write
+    concurrency:
+      group: ${{ github.workflow }}-${{ github.ref }}
+    # Hugo steps
     steps:
       - uses: actions/checkout@v3
         with:
@@ -57,13 +42,13 @@ jobs:
         uses: actions/[email protected]
         with:
           node-version: "16"
-            
+
       - name: Setup Hugo
         uses: peaceiris/actions-hugo@v2
         with:
-          hugo-version: 'latest'
+          hugo-version: '0.102.3'
           extended: true
-          
+
       - uses: actions/cache@v2
         with:
           path: /tmp/hugo_cache
@@ -71,17 +56,14 @@ jobs:
           restore-keys: |
             ${{ runner.os }}-hugomod-
 
-      - name: Build Site
-        env:
-          HUGO_ENV: production
+      - name: Build Site (minify)
         run: hugo --minify
 
-      - name: Deploy
+      - name: Deploy Site
         uses: peaceiris/actions-gh-pages@v3
-        if: github.event_name == 'push' # && github.ref == 'refs/heads/master'
+        if: ${{ github.ref == 'refs/heads/master' }}
         with:
           github_token: ${{ secrets.GITHUB_TOKEN }}
           # 
https://gohugo.io/hosting-and-deployment/hosting-on-github/#github-pages-setting
-          publish_branch: asf-site    # Settings > GitHub Pages set the source 
branch to this publish_branch
           publish_dir: ./public
-      # https://github.com/marketplace/actions/github-pages-action
+          publish_branch: asf-site    # Settings > GitHub Pages set the source 
branch to this publish_branch

Reply via email to