diff --git a/.github/workflows/deploy-documentation.yml b/.github/workflows/deploy-documentation.yml index 90eb47f08..fa54df29b 100644 --- a/.github/workflows/deploy-documentation.yml +++ b/.github/workflows/deploy-documentation.yml @@ -1,56 +1,63 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages -# Sample workflow for building and deploying a Jekyll site to GitHub Pages -name: Deploy Documentation to Pages +name: Build Docs on: - # Runs on pushes targeting the default branch push: - branches: ["develop"] - - # Allows you to run this workflow manually from the Actions tab + branches: + - master + - develop 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 +env: + base_url: /VSDS-Linked-Data-Interactions + title: "Linked Data Interactions" jobs: - # Build job + build: runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Pages - uses: actions/configure-pages@v3 + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 21 + - name: Determine version + id: version + run: | + export VERSION=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout) + echo "version=$VERSION" >> $>> $GITHUB_OUTPUT + - name: Setup Ruby + uses: ruby/setup-ruby@0a29871fe2b0200a17a4497bae54fe5df0d973aa + with: + ruby-version: '3.0' # Not needed with a .ruby-version file + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + cache-version: 0 # Increment this number if you need to re-download cached gems - name: Build with Jekyll - uses: actions/jekyll-build-pages@v1 + run: | + cd docs + bundle install + bundle exec jekyll build --baseurl "${{env.base_url}}/${{steps.version.outputs.version}}" -s "./" -d "./_site" + env: + JEKYLL_ENV: production + - uses: actions/setup-node@v3 with: - source: ./docs - destination: ./_site - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - - # Deployment job - 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@v2 + node-version: 16 + registry-url: https://npm.pkg.github.com/ + - run: npm i -g @koumoul/gh-pages-multi + - run: | + git config --global user.email "vsds@noreply.com" + git config --global user.name "VSDS CI" + git config --global url.https://${{ env.PAT }}@github.com/.insteadOf https://github.com/ + env: + PAT: ${{secrets.DEPLOY_DOCS_PAT}} + - run: | + gh-pages-multi deploy --title ${{env.title}} -t ${{steps.version.outputs.version}} -s docs/_site + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}