Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 29 additions & 7 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Deploy Dev Preview
on:
push:
branches: [dev]
workflow_dispatch:

permissions:
contents: read
Expand Down Expand Up @@ -41,17 +42,38 @@ jobs:
cp public/robots-dev.txt dist/robots.txt

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-artifact@v4
with:
name: github-pages
path: dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: github-pages
path: dist

- name: Deploy to Preview Repo
env:
PREVIEW_TOKEN: ${{ secrets.PREVIEW_REPO_TOKEN }}
run: |
cd dist
git init
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Configure git credentials securely
git config credential.helper store
echo "https://x-access-token:${PREVIEW_TOKEN}@github.com" > ~/.git-credentials

git add .
git commit -m "Deploy preview from ${{ github.sha }}"
git remote add origin https://github.com/medical-informatics-platform/mip-website-preview.git
git push -f origin HEAD:gh-pages

# Clean up credentials
rm ~/.git-credentials
1 change: 1 addition & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags:
- 'v*'
workflow_dispatch:

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
</div>
</footer>
</div>
<script type="module" src="/src/main.js"></script>
<script type="module" src="src/main.js"></script>
</body>

</html>
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { marked } from 'marked'
// Fetch and render Federations
async function loadFederations() {
try {
const response = await fetch('/content/federations.json');
const response = await fetch('content/federations.json');
const federations = await response.json();
const grid = document.getElementById('federations-grid');

Expand All @@ -31,7 +31,7 @@ async function loadFederations() {
// Fetch and render Documentation text
async function loadDocumentation() {
try {
const response = await fetch('/content/documentation.md');
const response = await fetch('content/documentation.md');
const text = await response.text();
const docContainer = document.getElementById('doc-text');

Expand Down