From 703bbe5dc3192e540fa9388d31c88e9fa4a000e4 Mon Sep 17 00:00:00 2001 From: Marie Katrine Ekeberg Date: Sun, 4 Aug 2024 10:06:20 +0200 Subject: [PATCH] Rewrite pipeline to not push to git, just deploy site directly Generate everything by need hopefully --- .github/workflows/jekyll.yml | 36 ++++++++++++------------------------ create_tag_pages.sh | 3 ++- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index 213f3849..6c122165 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -12,12 +12,15 @@ permissions: id-token: write jobs: - setupsite: - # [SKIP] Tag to skip Emacs org mode to html and tag generation - if: "!contains(github.event.head_commit.message, '[SKIP]')" + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1.190.0 + with: + ruby-version: '3.1' - uses: purcell/setup-emacs@v6.0 with: version: 28.1 @@ -25,26 +28,11 @@ jobs: run: ./emacs_headless_publish.sh - name: Setup new tags if any run: ./create_tag_pages.sh - # only publish the pages for master/main branch activity - - name: Publish new files if any - if: github.event_name != 'pull_request' + - name: Create report on generated tag pages run: | - git config --local user.email "action@github.com" && \ - git config --local user.name "GitHub Action" && \ - git add . && \ - git commit -am "[SKIP] New org mode articles and/or tags" && \ - git push - build: - runs-on: ubuntu-latest - needs: setupsite - if: "always()" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Ruby - uses: ruby/setup-ruby@v1.190.0 - with: - ruby-version: '3.1' + echo -e "

Tags made:

\n" >> $GITHUB_STEP_SUMMARY - name: Setup Pages id: pages uses: actions/configure-pages@v5 @@ -63,7 +51,7 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build - if: "always() && 'success' == needs.build.result && github.event_name != 'pull_request'" + if: "github.event_name != 'pull_request'" steps: - name: Deploy to GitHub Pages id: deployment diff --git a/create_tag_pages.sh b/create_tag_pages.sh index edbb302a..04820cca 100755 --- a/create_tag_pages.sh +++ b/create_tag_pages.sh @@ -2,11 +2,12 @@ TAGS=$(cat _posts/*.html | grep 'tags:' | sed -E 's/tags: (.)/\1/' | tr ' ' '\n' | sort -u) +mkdir -p tags + for tag in $TAGS do if [ ! -f tags/$tag.html ] then echo -e "---\ntitle: \"Tag: $tag\"\nlayout: tag\ntag: $tag\n---" > tags/$tag.html - git add tags/$tag.html fi done