Skip to content

linux-publish_techblog-main_web_site #3

linux-publish_techblog-main_web_site

linux-publish_techblog-main_web_site #3

#部署
name: "linux-publish_techblog-main_web_site"
on:
# push:
# branches:
# - master
# paths-ignore:
# # - .github/workflows/pub_web.yml
# - .gitignore
# - README.md
# - LICENSE
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build-docs:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# submodules: true
# Checkout private repo
- name: Checkout private repo
uses: actions/checkout@v3
with:
repository: linjonh/TechBlog
branch: main
token: ${{ secrets.PAT_TOKEN }}
path: .
#build
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4.2' # 替换为你项目实际使用的版本
bundler-cache: true
# Install ruby dependencies
- name: Install dependencies
run: |
pwd
ls -lh
cd TechBlog
gem install bundler
bundle install --jobs 4 --retry 3
- run: bundle exec jekyll build -d "_site${{ steps.pages.outputs.base_path }} --trace"
env:
JEKYLL_ENV: production
#Setup pages
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
# Upload the site artifact
- name: Upload site artifact
uses: actions/upload-pages-artifact@v3
with:
path: "TechBlog/_site${{ steps.pages.outputs.base_path }}"
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build-docs
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4