Skip to content

add jsonld to gh-pages index #35

add jsonld to gh-pages index

add jsonld to gh-pages index #35

Workflow file for this run

name: Publish
on:
push:
branches:
- main
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: |
mkdir -p release/1.0.0
mkdir -p release/resources
cp src/refdataproject_combined.ttl release/1.0.0/tensiletest_42CrMoS4.ttl
cp src/refdataproject_combined.rdf release/1.0.0/tensiletest_42CrMoS4.rdf
cp src/refdataproject_combined.jsonld release/1.0.0/tensiletest_42CrMoS4.jsonld
cat src/resources.txt | xargs -I {} touch src/{}
cat src/resources.txt | xargs -I {} cp src/{} release/resources/
python src/.github/workflows/index.html.py -f release/index.html -t ${{ github.event.repository.name }} -o $GITHUB_REPOSITORY_OWNER -n ${{ github.event.repository.name }} -r tensiletest_42CrMoS4 -l src/resources.txt -v 1.0.0
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 }}