From cd29747fcc37d796e1a857afbdb62447c146a2be Mon Sep 17 00:00:00 2001 From: Carsten Behring Date: Wed, 9 Oct 2024 09:50:32 +0200 Subject: [PATCH] run githup pages as in noj --- .github/workflows/main.yml | 53 ++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 218483c9..14fa55f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,22 +1,20 @@ name: Build tutorials page on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - + - push + +permissions: + contents: read + pages: write + id-token: write + packages: write + jobs: render-tutorials: runs-on: ubuntu-latest - concurrency: - group: build-tutorial - cancel-in-progress: true - permissions: - contents: write steps: - uses: actions/checkout@v4 @@ -107,15 +105,26 @@ jobs: run: clojure notebooks/render_index.clj - - name: check git status - run: | - git config user.name github-actions - git config user.email github-actions@github.com - ls docs/projects - git status - - - - name: push updated docs - uses: stefanzweifel/git-auto-commit-action@v5 - - + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./docs + destination: ./_site + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + deploy-pages: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + # only run github-pages deployemnts on main, not on PRs for example + if: github.ref == 'refs/heads/main' + needs: render-tutorials + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4