Skip to content

Update index.py

Update index.py #42

Workflow file for this run

name: Publish
on:
push:
branches:
- main
- patch_html
jobs:
create:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: src
- name: Generate TTL files
id: gen_ttls
run: |
python -m pip install rdflib numpy
cd src
python gen_refdataproject_tensiletest_datasets.py -n https://w3id.org/pmd/demodata/tensiletest_42CrMoS4/
python gen_refdataproject_tensiletests.py -n https://w3id.org/pmd/demodata/tensiletest_42CrMoS4/
python gen_refdataproject_production.py -n https://w3id.org/pmd/demodata/tensiletest_42CrMoS4/
python gen_combined_ttl.py -n https://w3id.org/pmd/demodata/tensiletest_42CrMoS4/
- name: Prepare release files
id: prepare_files
run: |
python -m pip install lxml cssselect
mkdir -p release/1.0.0
mkdir -p release/resources
cp src/refdataproject_combined.ttl release/1.0.0/onto.ttl
cp src/refdataproject_combined.rdf release/1.0.0/onto.rdf
cp src/refdataproject_combined.jsonld release/1.0.0/onto.jsonld
cat src/resources.txt | xargs -I {} touch src/{}
cat src/resources.txt | xargs -I {} cp src/{} release/resources/
curl -O https://code.jquery.com/jquery-3.7.1.min.js
cp jquery-3.7.1.min.js release/jquery-3.7.1.min.js
python src/.github/workflows/index.py -f release/index.html -t src/.github/workflows/index.html_tmp -l src/resources.txt
cp src/.github/workflows/.htaccess_tmp release/.htaccess
sed -i "s/{{latest_version}}/1.0.0/g" release/.htaccess
REPO_OWNER_LOWERCASE=$(echo "$GITHUB_REPOSITORY_OWNER" | tr '[:upper:]' '[:lower:]')
sed -i "s/{{base_uri}}/https:\/\/$REPO_OWNER_LOWERCASE.github.io\/${{ github.event.repository.name }}/g" release/.htaccess
- name: Generate Artifact
uses: actions/upload-artifact@v4
with:
name: release
path: release
- name: Publish to gh-pages
if: success()
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: ./release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}