OSDN Git Service

[update] : Run action only master
authorhayao <hayao@fascode.net>
Sat, 23 Oct 2021 08:33:32 +0000 (17:33 +0900)
committerhayao <hayao@fascode.net>
Sat, 23 Oct 2021 08:33:32 +0000 (17:33 +0900)
.github/workflows/hugo.yaml

index 727ee85..534fe35 100644 (file)
@@ -1,6 +1,10 @@
 name: Hugo Build and Deploy
 
-on: push
+on: 
+  push:
+    branches:
+      - main
+      - master
 
 jobs:
   gh-pages:
@@ -42,10 +46,6 @@ jobs:
   main-repo:
     runs-on: ubuntu-latest
     steps:
-      - name: Check repo
-        run: |
-          echo $GITHUB_REPOSITORY
-          [[ "$(basename "${GITHUB_REPOSITORY}")" = "hayao0819.github.io" ]] && exit 0
       - name: Checkout
         uses: actions/checkout@v2
         with:
@@ -86,5 +86,6 @@ jobs:
             echo "Nothing has been commited"
           fi
           git pull --allow-unrelated-histories origin master
-          git push origin master
-    
+          git checkout -b gh-pages
+          git push origin gh-pages
+    
\ No newline at end of file