File tree Expand file tree Collapse file tree 4 files changed +33
-10
lines changed
Expand file tree Collapse file tree 4 files changed +33
-10
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ name: Deploy Dev Preview
33on :
44 push :
55 branches : [dev]
6+ workflow_dispatch :
67
78permissions :
89 contents : read
@@ -41,17 +42,38 @@ jobs:
4142 cp public/robots-dev.txt dist/robots.txt
4243
4344 - name : Upload artifact
44- uses : actions/upload-pages- artifact@v3
45+ uses : actions/upload-artifact@v4
4546 with :
47+ name : github-pages
4648 path : dist
4749
4850 deploy :
49- environment :
50- name : github-pages
51- url : ${{ steps.deployment.outputs.page_url }}
5251 runs-on : ubuntu-latest
5352 needs : build
5453 steps :
55- - name : Deploy to GitHub Pages
56- id : deployment
57- uses : actions/deploy-pages@v4
54+ - name : Download artifact
55+ uses : actions/download-artifact@v4
56+ with :
57+ name : github-pages
58+ path : dist
59+
60+ - name : Deploy to Preview Repo
61+ env :
62+ PREVIEW_TOKEN : ${{ secrets.PREVIEW_REPO_TOKEN }}
63+ run : |
64+ cd dist
65+ git init
66+ git config user.name "github-actions[bot]"
67+ git config user.email "github-actions[bot]@users.noreply.github.com"
68+
69+ # Configure git credentials securely
70+ git config credential.helper store
71+ echo "https://x-access-token:${PREVIEW_TOKEN}@github.com" > ~/.git-credentials
72+
73+ git add .
74+ git commit -m "Deploy preview from ${{ github.sha }}"
75+ git remote add origin https://github.com/medical-informatics-platform/mip-website-preview.git
76+ git push -f origin HEAD:gh-pages
77+
78+ # Clean up credentials
79+ rm ~/.git-credentials
Original file line number Diff line number Diff line change 44 push :
55 tags :
66 - ' v*'
7+ workflow_dispatch :
78
89permissions :
910 contents : read
Original file line number Diff line number Diff line change 154154 </ div >
155155 </ footer >
156156 </ div >
157- < script type ="module " src ="/ src/main.js "> </ script >
157+ < script type ="module " src ="src/main.js "> </ script >
158158</ body >
159159
160160</ html >
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { marked } from 'marked'
44// Fetch and render Federations
55async function loadFederations ( ) {
66 try {
7- const response = await fetch ( '/ content/federations.json' ) ;
7+ const response = await fetch ( 'content/federations.json' ) ;
88 const federations = await response . json ( ) ;
99 const grid = document . getElementById ( 'federations-grid' ) ;
1010
@@ -31,7 +31,7 @@ async function loadFederations() {
3131// Fetch and render Documentation text
3232async function loadDocumentation ( ) {
3333 try {
34- const response = await fetch ( '/ content/documentation.md' ) ;
34+ const response = await fetch ( 'content/documentation.md' ) ;
3535 const text = await response . text ( ) ;
3636 const docContainer = document . getElementById ( 'doc-text' ) ;
3737
You can’t perform that action at this time.
0 commit comments