Skip to content

Commit

Permalink
chore: add workflow and optimize readme
Browse files Browse the repository at this point in the history
  • Loading branch information
xdsdmg committed Jun 12, 2024
1 parent 9047145 commit 1af0a29
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 10 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/my-github-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: [$default-branch]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
with:
ruby-version: '3.1' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
run:
cd docs && bundle exec jekyll serve
cd docs && bundle exec jekyll serve

build:
cd docs && bundle exec jekyll build
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Record & Share

## Content
This is my personal blog.

- [Debian 通过编译源码安装 Python3](docs/debian-python3-install.md)
- [Windows 与 WSL 配置](docs/wsl-config.md)
- [eBPF](docs/ebpf.md)
- [VirtualBox Ubuntu 22.04 配置网络](docs/virtualbox-ubuntu-network.md)
## Requirements

## Github page
- [jekyll](https://jekyllrb.com/)

- [Creating a GitHub Pages site with Jekyll](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll)
- [Testing your GitHub Pages site locally with Jekyll](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll)
- [Configuring a publishing source for your GitHub Pages site](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site)
tips:

In MacOS, webrick needs to be added to bundle.

``` Shell
bundle add webrick
```
2 changes: 2 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

gem "webrick", "~> 1.8"
5 changes: 5 additions & 0 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ GEM
jekyll-seo-tag (~> 2.1)
minitest (5.22.2)
mutex_m (0.2.0)
nokogiri (1.15.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.5-x86_64-linux)
racc (~> 1.4)
octokit (4.25.1)
Expand Down Expand Up @@ -261,8 +263,10 @@ GEM
unf_ext
unf_ext (0.0.9.1)
unicode-display_width (1.8.0)
webrick (1.8.1)

PLATFORMS
arm64-darwin-23
x86_64-linux

DEPENDENCIES
Expand All @@ -275,6 +279,7 @@ DEPENDENCIES
tzinfo (>= 1, < 3)
tzinfo-data
wdm (~> 0.1.1)
webrick (~> 1.8)

BUNDLED WITH
2.4.22

0 comments on commit 1af0a29

Please sign in to comment.