Skip to content

update data.csv

update data.csv #10

name: Generate Redirects
on:
push:
branches:
- master
paths:
- '.github/workflows/data.csv'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
# Default to bash
defaults:
run:
shell: bash
jobs:
generate_redirects:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate redirect pages
run: |
while IFS=',' read -r name url; do
filename=$(echo "$name" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')
mkdir -p "public/$filename"
cat > "public/$filename/index.html" << EOL
<!DOCTYPE html>
<html>
<head>
<title>$name</title>
<meta http-equiv="refresh" content="0; URL='$url'" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
</head>
<body>
<p>Connecting to JupyterLab server ...</p>
</body>
</html>
EOL
done < ".github/workflows/data.csv"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: generate_redirects
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4