@@ -30,16 +30,32 @@ jobs:
30
30
make html
31
31
mv build/html /tmp
32
32
cd ..
33
- - name : Prepare local gh-pages branch
33
+ - name : Deploy to gh-pages branch
34
34
env :
35
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35
+ GH_ACTION_PAGES_DEPLOY_KEY : ${{ secrets.GH_ACTION_PAGES_DEPLOY_KEY }}
36
36
run : |
37
- #git remote rm origin
38
- #git remote add origin "https://${GITHUB_TOKEN}@github.com/numpy/numpy-financial.git"
39
- git config user.email "github.workflow@nomail"
40
- git config user.name "none"
37
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
38
+ # Set up SSH key
39
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
40
+ mkdir -p ~/.ssh/
41
+ echo "$GH_ACTION_PAGES_DEPLOY_KEY" > ~/.ssh/id_rsa
42
+ chmod 600 ~/.ssh/id_rsa
43
+ ssh-keyscan github.com >> ~/.ssh/known_hosts
44
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
45
+ # Reconfigure the git remote to use SSH
46
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
47
+ git remote rm origin
48
+ git remote add origin [email protected] :numpy/numpy-financial.git
49
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
50
+ # Configure the git user
51
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
52
+ git config user.name "${GITHUB_ACTOR}"
53
+ git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
54
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
55
+ # Go to work on gh-pages...
56
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
41
57
echo "Fetching gh-pages"
42
- git fetch "https://${GITHUB_TOKEN}@github.com/numpy/numpy-financial.git" gh-pages
58
+ git fetch origin gh-pages
43
59
echo "Checking out gh-pages branch"
44
60
git checkout gh-pages
45
61
echo "Removing old documentation"
53
69
echo "Adding new documentation"
54
70
git add -A
55
71
git commit -m "Add new documentation"
56
- - name : Push the new documentation to gh-pages
57
- env :
58
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59
- run : |
60
72
echo "Pushing new documentation to origin"
61
- git push -v "https://${GITHUB_TOKEN}@github.com/numpy/numpy-financial.git" gh-pages
73
+ git push -v origin gh-pages
0 commit comments