Skip to content

Commit ae36364

Browse files
committed
test publish
1 parent 9162d22 commit ae36364

File tree

1 file changed

+35
-31
lines changed

1 file changed

+35
-31
lines changed

.github/workflows/docs.yml

+35-31
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ on:
44
push:
55
branches:
66
- master
7+
paths:
8+
- "docs/**"
79
pull_request:
810
branches:
911
- master
12+
paths:
13+
- "docs/**"
1014

1115
concurrency:
1216
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -64,11 +68,11 @@ jobs:
6468
- uses: actions/checkout@v4
6569
with:
6670
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 }}
7276

7377
- name: Download docs
7478
uses: actions/download-artifact@v4
@@ -82,29 +86,29 @@ jobs:
8286
mv tmp/dist/ dist/
8387
rm -rf tmp/
8488
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

Comments
 (0)