Repository navigation
Fix dark mode entirely #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: LDES Vocabulary Build | |
| on: | |
| pull_request: | |
| paths: ["vocabulary.bs", "vocabulary.ttl", "*.svg", "*.png", "*.jpg", "*.jpeg", "*.webp", "header.include", "footer.include", "logo.include", "assets/**"] | |
| push: | |
| branches: ["master"] | |
| tags: ["*"] | |
| paths: ["vocabulary.bs", "vocabulary.ttl", "*.svg", "*.png", "*.jpg", "*.jpeg", "*.webp", "header.include", "footer.include", "logo.include", "assets/**", ".github/workflows/ldes-vocabulary-build.yml"] | |
| workflow_dispatch: | |
| concurrency: | |
| group: gh-pages-publish | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| SEMICMATOMOID: ${{ secrets.SEMICMATOMOID }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Publish Bikeshed document | |
| if: ${{ env.SEMICMATOMOID == '' }} | |
| uses: w3c/spec-prod@v2 | |
| with: | |
| TOOLCHAIN: bikeshed | |
| # Modify as appropriate | |
| GH_PAGES_BRANCH: gh-pages | |
| # The source file | |
| SOURCE: vocabulary.bs | |
| # output filename defaults to your input | |
| # with .html extension instead, | |
| # but if you want to customize it: | |
| DESTINATION: ${{ startsWith(github.ref, 'refs/tags/') && 'vocabulary.html' || 'workingdraft/vocabulary.html' }} | |
| - name: Publish Bikeshed document with Matomo | |
| if: ${{ env.SEMICMATOMOID != '' }} | |
| uses: w3c/spec-prod@v2 | |
| with: | |
| TOOLCHAIN: bikeshed | |
| GH_PAGES_BRANCH: gh-pages | |
| SOURCE: vocabulary.bs | |
| DESTINATION: ${{ startsWith(github.ref, 'refs/tags/') && 'vocabulary.html' || 'workingdraft/vocabulary.html' }} | |
| GH_PAGES_BUILD_OVERRIDE: | | |
| Text Macro: SEMICMATOMOID ${{ env.SEMICMATOMOID }} | |
| copy-working-draft-assets: | |
| name: Copy working draft assets | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout gh-pages | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: gh-pages | |
| fetch-depth: 0 | |
| - name: Checkout source snapshot | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ github.sha }} | |
| path: source-snapshot | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - name: Install GraphViz | |
| run: sudo apt-get update && sudo apt-get install -y graphviz | |
| - name: Download PlantUML | |
| run: curl -L -o /tmp/plantuml.jar https://github.com/plantuml/plantuml/releases/download/v1.2024.7/plantuml-1.2024.7.jar | |
| - name: Copy working draft assets | |
| run: | | |
| set -euo pipefail | |
| java -Djava.awt.headless=true -jar /tmp/plantuml.jar -tsvg source-snapshot/assets/*.puml | |
| mkdir -p assets | |
| cp source-snapshot/assets/logo-ldes.svg assets/logo-ldes.svg | |
| mkdir -p workingdraft/assets | |
| cp source-snapshot/vocabulary.ttl workingdraft/vocabulary.ttl | |
| find source-snapshot -maxdepth 1 -type f \( -iname "*.svg" -o -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.webp" \) -exec cp {} workingdraft/ \; | |
| cp -R source-snapshot/assets/. workingdraft/assets/ | |
| rm -f workingdraft/assets/logo-ldes.svg | |
| rm -rf source-snapshot | |
| if git status --porcelain | grep . >/dev/null; then | |
| git config user.email "semic-eu+github-actions[bot]@users.noreply.github.com" | |
| git config user.name "SEMIC EU archival [bot]" | |
| git add assets/logo-ldes.svg workingdraft | |
| git commit -m "Update vocabulary working draft assets" | |
| git push | |
| else | |
| echo "No changes to commit." | |
| fi | |
| copy-tag-version: | |
| name: Copy tag snapshot | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout gh-pages | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: gh-pages | |
| fetch-depth: 0 | |
| - name: Checkout source snapshot | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ github.ref }} | |
| path: source-snapshot | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - name: Install GraphViz | |
| run: sudo apt-get update && sudo apt-get install -y graphviz | |
| - name: Download PlantUML | |
| run: curl -L -o /tmp/plantuml.jar https://github.com/plantuml/plantuml/releases/download/v1.2024.7/plantuml-1.2024.7.jar | |
| - name: Copy vocabulary snapshot | |
| run: | | |
| set -euo pipefail | |
| java -Djava.awt.headless=true -jar /tmp/plantuml.jar -tsvg source-snapshot/assets/*.puml | |
| tag="${GITHUB_REF_NAME}" | |
| dest="releases/${tag}" | |
| mkdir -p "${dest}" | |
| cp vocabulary.html "${dest}/vocabulary.html" | |
| cp source-snapshot/vocabulary.ttl "${dest}/vocabulary.ttl" | |
| find source-snapshot -maxdepth 1 -type f \( -iname "*.svg" -o -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.webp" \) -exec cp {} "${dest}/" \; | |
| mkdir -p assets | |
| cp source-snapshot/assets/logo-ldes.svg assets/logo-ldes.svg | |
| mkdir -p "${dest}/assets" | |
| cp -R source-snapshot/assets/. "${dest}/assets/" | |
| rm -f "${dest}/assets/logo-ldes.svg" | |
| rm -f vocabulary.ttl | |
| ln -s "${dest}/vocabulary.ttl" vocabulary.ttl | |
| rm -rf source-snapshot | |
| cat > vocabulary.html <<EOF | |
| <!doctype html> | |
| <meta charset="utf-8"> | |
| <title>Redirecting to LDES Vocabulary ${tag}</title> | |
| <meta http-equiv="refresh" content="0; url=${dest}/vocabulary.html"> | |
| <link rel="canonical" href="${dest}/vocabulary.html"> | |
| <p>Latest release: <a href="${dest}/vocabulary.html">${dest}/vocabulary.html</a></p> | |
| EOF | |
| if git status --porcelain | grep . >/dev/null; then | |
| git config user.email "semic-eu+github-actions[bot]@users.noreply.github.com" | |
| git config user.name "SEMIC EU archival [bot]" | |
| git add vocabulary.html vocabulary.ttl assets/logo-ldes.svg "${dest}" | |
| git commit -m "Add vocabulary snapshot for ${tag}" | |
| git push | |
| else | |
| echo "No changes to commit." | |
| fi |