4
4
push :
5
5
branches :
6
6
- master
7
+ paths :
8
+ - " docs/**"
7
9
pull_request :
8
10
branches :
9
11
- master
12
+ paths :
13
+ - " docs/**"
10
14
11
15
concurrency :
12
16
group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -64,11 +68,11 @@ jobs:
64
68
- uses : actions/checkout@v4
65
69
with :
66
70
ref : gh-pages
67
- # - uses: actions/create-github-app-token@v1
68
- # id: app-token
69
- # with:
70
- # app-id: ${{ secrets.GH_APP_SAS_APP_ID }}
71
- # private-key: ${{ secrets.GH_APP_SAS_APP_KEY }}
71
+ - uses : actions/create-github-app-token@v1
72
+ id : app-token
73
+ with :
74
+ app-id : ${{ secrets.GH_APP_SAS_APP_ID }}
75
+ private-key : ${{ secrets.GH_APP_SAS_APP_KEY }}
72
76
73
77
- name : Download docs
74
78
uses : actions/download-artifact@v4
@@ -82,29 +86,29 @@ jobs:
82
86
mv tmp/dist/ dist/
83
87
rm -rf tmp/
84
88
git status
85
- # - name: Push changes to gh-pages
86
- # env:
87
- # TOKEN: ${{ steps.app-token.outputs.token }}
88
- # APP_NAME: "paritytech-upd-ghpages-sas"
89
- # REF_NAME: ${{ github.head_ref || github.ref_name }}
90
- # Green: "\e[32m"
91
- # NC: "\e[0m"
92
- # run: |
93
- # echo "${Green}Git add${NC}"
94
- # git add dist/
95
-
96
- # echo "${Green}git status | wc -l${NC}"
97
- # git status | wc -l
98
-
99
- # echo "${Green}Add new remote with gh app token${NC}"
100
- # git remote set-url origin $(git config remote.origin.url | sed "s/github.com/${APP_NAME}:${TOKEN}@github.com/g")
101
-
102
- # echo "${Green}Remove http section that causes issues with gh app auth token${NC}"
103
- # sed -i.bak '/\[http/d' ./.git/config
104
- # sed -i.bak '/extraheader/d' ./.git/config
105
-
106
- # echo "${Green}Git push${NC}"
107
- # git config user.email "[email protected] "
108
- # git config user.name "${APP_NAME}"
109
- # git commit --amend -m "___Updated docs" || echo "___Nothing to commit___"
110
- # git push origin gh-pages --force
89
+ - name : Push changes to gh-pages
90
+ env :
91
+ TOKEN : ${{ steps.app-token.outputs.token }}
92
+ APP_NAME : " paritytech-upd-ghpages-sas"
93
+ REF_NAME : ${{ github.head_ref || github.ref_name }}
94
+ Green : " \e [32m"
95
+ NC : " \e [0m"
96
+ run : |
97
+ echo "${Green}Git add${NC}"
98
+ git add dist/
99
+
100
+ echo "${Green}git status | wc -l${NC}"
101
+ git status | wc -l
102
+
103
+ echo "${Green}Add new remote with gh app token${NC}"
104
+ git remote set-url origin $(git config remote.origin.url | sed "s/github.com/${APP_NAME}:${TOKEN}@github.com/g")
105
+
106
+ echo "${Green}Remove http section that causes issues with gh app auth token${NC}"
107
+ sed -i.bak '/\[http/d' ./.git/config
108
+ sed -i.bak '/extraheader/d' ./.git/config
109
+
110
+ echo "${Green}Git push${NC}"
111
+ git config user.email "[email protected] "
112
+ git config user.name "${APP_NAME}"
113
+ git commit -m "___Updated docs" || echo "___Nothing to commit___"
114
+ git push origin gh-pages --force
0 commit comments