From 9d85a35f382cf602204a79dc00fa886f446a6f61 Mon Sep 17 00:00:00 2001 From: kB01 Date: Thu, 11 Apr 2024 19:38:49 +0200 Subject: [PATCH] Added Build Forgejo Actions --- .github/workflows/main.yml | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..79371b4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,59 @@ +name: CI + +on: [push] + +jobs: + build: + env: + HUGO_VERSION: ${{ github.sha }} + TZ: Asia/Shanghai + runs-on: ubuntu-latest + + steps: + - name: Git checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: true + + - name: Set git config core.quotepath false # https://github.com/gohugoio/hugo/issues/9810#issuecomment-1107519804 + run: git config --global core.quotepath false + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '21.x' + + - name: Install Theme + run: cd themes/kb-one-de-theme && yarn install --production + + - name: Install PostCSS-CLI + run: npm install postcss-cli -g + + - name: Setup hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: '0.123.8' + extended: true + + - name: Build Hugo + run: echo "HUGO_VERSION -> $HUGO_VERSION" && hugo --gc --minify --cleanDestinationDir + + - name: Hugo-Encrypt + run: cd themes/kb-one-de-theme && node ./hugo-encrypt.js + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: public + path: ./public + + - name: prerelease + if: ${{ false }} + uses: actions/forgejo-release@v1 + with: + direction: upload + url: https://git.kb-one.de/ + release-dir: ./public + release-notes: "Automatic built Pre-Release for $HUGO_VERSION" + prerelease: true \ No newline at end of file