From 4de72beda6c8f5f372b8a1df940ec7b6b17bd25e Mon Sep 17 00:00:00 2001 From: dongdigua Date: Sat, 30 Mar 2024 16:49:12 +0800 Subject: [PATCH] CI: use makefile to imporve workflow don't forget PHONY --- .github/workflows/site.yml | 31 ++++++++----------------------- Makefile | 6 +++--- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml index d6e49ee..471b595 100644 --- a/.github/workflows/site.yml +++ b/.github/workflows/site.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 30 fetch-tags: true @@ -27,23 +27,18 @@ jobs: - name: Install Emacs uses: purcell/setup-emacs@master with: - version: 28.2 + version: 29.3 - - name: Prepare + - name: make run: | - curl "https://raw.githubusercontent.com/dongdigua/configs/main/.tmux.conf" -o misc/tmux.conf - - - name: Build with Org - run: | - make describe - cd org - make clean + sudo apt-get -q install pandoc make - cd .. + curl "https://raw.githubusercontent.com/dongdigua/configs/main/.tmux.conf" -o misc/tmux.conf ./patches/txt.sh + ./patches/color.sh - name: Setup Pages - uses: actions/configure-pages@v2 + uses: actions/configure-pages@v5 - name: Build with Jekyll uses: actions/jekyll-build-pages@v1 @@ -51,18 +46,8 @@ jobs: source: ./ destination: ./_site - - name: Post-Jekyll Build - run: | - tree - cd _site - sudo ./patches/color.sh - sudo apt install pandoc - # use jekyll to check link but actually use pandoc - sudo pandoc posts.md --css=css/everforest.css -s -o posts.html - - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v3 deploy: environment: diff --git a/Makefile b/Makefile index 7764c37..20549af 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ -all: org posts gmi +all: describe org posts gmi +.PHONY: org org: - cd org && make + cd org; $(MAKE) posts: pandoc posts.md --css=css/everforest.css -s -o posts.html @@ -10,7 +11,6 @@ gmi: misc/mdlist2gmi.py > posts.gmi describe: - git describe --tags HEAD sed -i "s/\$$v\\$$/\$$v: $$(git describe --tags HEAD)\\$$/g" index.html clean: