From 60d2412e618c0b65f2b9f786d5e1c35a546b9bdc Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Wed, 28 Jan 2026 08:07:28 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=B0=86=E7=AB=99=E7=82=B9=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E8=BF=81=E7=A7=BB=E8=87=B3=20GitHub=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 44 ++++++++++++++----------------------- .github/workflows/build.yml | 37 +++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.drone.yml b/.drone.yml index 5a9165a2..924b4f2e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,33 +5,23 @@ name: default clone: depth: 1 +trigger: + branch: + - pages + event: + - push + steps: -- name: build - image: ruby:3.4 - environment: - JEKYLL_ENV: production - BUNDLE_PATH: vendor/bundle - commands: - - bundle config mirror.https://rubygems.org https://mirrors.cloud.tencent.com/rubygems - - bundle install --verbose - - bundle exec jekyll build --trace --verbose --config _config.yml,_config.drone.yml - volumes: - - name: dist - path: /drone/src/_site - - name: vendor - path: /drone/src/vendor - - name: jekyll-cache - path: /drone/src/.jekyll-cache - when: - branch: [main] + - name: deploy + image: alpine + volumes: + - name: site + path: /site + commands: + - apk add --no-cache rsync + - rsync -rtv --delete --exclude .git ./ /site/ volumes: -- name: dist - host: - path: /home/ubuntu/docs.hmcl.net/www -- name: vendor - host: - path: /home/ubuntu/docs.hmcl.net/cache/vendor -- name: jekyll-cache - host: - path: /home/ubuntu/docs.hmcl.net/cache/jekyll-cache + - name: site + host: + path: /home/ubuntu/docs.hmcl.net/www diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..0fbb5ff3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,37 @@ +name: Build + +on: + push: + branches: + - main + +jobs: + run: + if: ${{ github.repository_owner == 'HMCL-dev' }} + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + cache-version: main + - name: Build + run: bundle exec jekyll build --trace --config _config.yml,_config.drone.yml --destination /home/runner/site + - name: Deploy to pages branch + working-directory: /home/runner/site + run: | + git init + git checkout --orphan pages + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "deploy: $(date -u +'%Y-%m-%d %H:%M:%S UTC')" + git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git + git push origin pages --force From d5689c5473d58ddbe07023582dc6a7dddefadffe Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Wed, 28 Jan 2026 08:09:10 +0800 Subject: [PATCH 2/6] update --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fbb5ff3..03b935c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: contents: write steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Setup Ruby From 5850fbb66a0def061eb2ede0f1d8efe7957e23f7 Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Wed, 28 Jan 2026 08:11:43 +0800 Subject: [PATCH 3/6] update --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 924b4f2e..8df3f52c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,7 +13,7 @@ trigger: steps: - name: deploy - image: alpine + image: alpine:3.23.2 volumes: - name: site path: /site From 02ee01982e430233be457801940d1e5a843a247d Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Wed, 28 Jan 2026 08:20:10 +0800 Subject: [PATCH 4/6] update --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8df3f52c..375ab430 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,8 +18,8 @@ steps: - name: site path: /site commands: - - apk add --no-cache rsync - - rsync -rtv --delete --exclude .git ./ /site/ + - rm -rf /site/* + - cp -r ./* /site/ volumes: - name: site From 643f5ab821354f75d26a90965222d18537fd7581 Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Wed, 28 Jan 2026 08:28:54 +0800 Subject: [PATCH 5/6] update --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03b935c3..ff4d04f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,9 @@ on: branches: - main +env: + JEKYLL_ENV: production + jobs: run: if: ${{ github.repository_owner == 'HMCL-dev' }} From 5be432d28696994c3be205376ab286fe31c0b414 Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Wed, 28 Jan 2026 14:18:48 +0800 Subject: [PATCH 6/6] update --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 375ab430..4012a7ed 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,7 +19,7 @@ steps: path: /site commands: - rm -rf /site/* - - cp -r ./* /site/ + - mv ./* /site/ volumes: - name: site