Compare commits

..

No commits in common. "4391943d9778d671641efa4e106d2fa051ea1201" and "c24535d7d94c4fd98043d70c3eaf4d67d637f9a2" have entirely different histories.

4 changed files with 64 additions and 29 deletions

View File

@ -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
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:3.23.2
volumes:
- name: site
path: /site
commands:
- rm -rf /site/*
- mv ./* /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

40
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: Build
on:
push:
branches:
- main
env:
JEKYLL_ENV: production
jobs:
run:
if: ${{ github.repository_owner == 'HMCL-dev' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
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

7
_config.drone.yml Normal file
View File

@ -0,0 +1,7 @@
footer:
links:
- label: Github
icon: fab fa-fw fa-github
url: https://github.com/HMCL-dev/HMCL
- label: 粤ICP备18071565号
url: https://beian.miit.gov.cn

View File

@ -270,8 +270,6 @@ footer:
- label: Github
icon: fab fa-fw fa-github
url: https://github.com/HMCL-dev/HMCL
- label: 粤ICP备18071565号
url: https://beian.miit.gov.cn
# since:
# minimal-mistakes (with jekyll-paginate-v2) https://github.com/sverrirs/jekyll-paginate-v2/blob/master/README-GENERATOR.md#site-configuration