@@ -59,13 +59,20 @@ jobs:
59
59
env :
60
60
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
61
61
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
62
- pages :
63
- if : github.ref == 'refs/heads/main'
62
+
63
+ build-pages :
64
+ name : Build to GitHub Pages
64
65
needs : release
65
66
runs-on : ubuntu-latest
67
+ env :
68
+ VITE_REACT_DEPLOY_DOCUMENTATION : DOCUMENTATION
69
+
66
70
steps :
67
- - uses : actions/checkout@v3
68
- - uses : actions/setup-node@v3
71
+ - name : Checkout repo
72
+ uses : actions/checkout@v3
73
+
74
+ - name : Setup Node
75
+ uses : actions/setup-node@v3
69
76
with :
70
77
node-version : 14.21.3
71
78
cache : ' npm'
76
83
run : |
77
84
ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts
78
85
shell : bash
79
- - name : Deploy to GH Pages with vite server
80
- env :
81
- GH_TOKEN : eclass:${{ secrets.GITHUB_TOKEN }}
82
- VITE_REACT_DEPLOY_DOCUMENTATION : ${{secrets.VITE_REACT_DEPLOY_DOCUMENTATION}}
83
- run : npm run deploy
86
+ - name : Clean install on CI
87
+ run : npm ci
88
+ - name : Generate new Build to Pages
89
+ run : npm run build
90
+ - name : Upload deploy-ready build files
91
+ uses : actions/upload-artifact@v3
92
+ with :
93
+ name : deploy-files
94
+ path : ./dist
95
+
96
+ deploy-pages :
97
+ name : Deploy GitHub Pages
98
+ needs : build-pages
99
+ runs-on : ubuntu-latest
100
+ if : github.ref == 'refs/heads/main'
101
+
102
+ env :
103
+ VITE_REACT_DEPLOY_DOCUMENTATION : DOCUMENTATION
104
+
105
+ steps :
106
+ - name : Download artifact
107
+ uses : actions/download-artifact@v3
108
+ with :
109
+ name : deploy-files
110
+ path : ./dist
84
111
112
+ # - uses: actions/checkout@v3
113
+ # - uses: actions/setup-node@v3
114
+ # with:
115
+ # node-version: 14.21.3
116
+ # cache: 'npm'
117
+ # - uses: webfactory/ssh-agent@v0.7.0
118
+ # with:
119
+ # ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
120
+ # - name: Add Know Hosts
121
+ # run: |
122
+ # ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts
123
+ # shell: bash
124
+ # - name: Clean install on CI
125
+ # run: npm ci
126
+ # - name: Generate new Build to Pages
127
+ # run: npm run build
128
+ # - name: Download artifact
129
+ # uses: actions/download-artifact@v3
130
+ # with:
131
+ # name:
132
+
133
+ - name : Deploy to GitHub Pages
134
+ uses : peaceiris/actions-gh-pages@v3
135
+ with :
136
+ github_token : eclass:${{ secrets.GITHUB_TOKEN }}
137
+ publish_dir : ./dist
0 commit comments