Skip to content

Build & Release Book #28

Build & Release Book

Build & Release Book #28

Workflow file for this run

name: Build & Release Book
on:
workflow_dispatch:
inputs:
version:
description: 'The release version of the gitbook, such as v1.1.1'
required: true
default: 'v1.1.0'
env:
DEBIAN_FRONTEND: noninteractive
jobs:
get-upload-url:
runs-on: ubuntu-latest
steps:
- uses: johnyherangi/create-release-notes@main
id: create-release-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/create-release@v1
id: create-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Build for ${{ github.event.inputs.version }}
body: ${{ steps.create-release-notes.outputs.release-notes }}
outputs:
upload-url: ${{ steps.create-release.outputs.upload_url }}
build:
needs: get-upload-url
name: Build & Release
runs-on: ubuntu-latest
steps:
- name: Setup Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Checkout main source
uses: actions/checkout@v4
- name: Install Quarto Extensions
working-directory: ${{ github.workspace }}
run: |
quarto add --no-prompt quarto-ext/include-code-files
quarto install --no-prompt tinytex
- name: Render and Publish
run: |
quarto render
- name: package the book
working-directory: ${{ github.workspace }}
run: |
mv public LLM_in_Action && tar czvf LLM_in_Action.tar.gz LLM_in_Action/*
ls .
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.get-upload-url.outputs.upload-url }}
asset_path: LLM_in_Action.tar.gz
asset_name: LLM_in_Action.tar.gz
asset_content_type: application/octet-stream
trigger:
needs: build
name: Trigger the wangwei1237.github.io_src deploy
runs-on: ubuntu-latest
steps:
- name: trigger the wangwei1237.github.io_src deploy
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.TOKEN }}" \
https://api.github.com/repos/wangwei1237/wangwei1237.github.io_src/dispatches \
-d '{"event_type":"update", "client_payload":{"from": "${{ github.repository }}", "msg": "${{ github.event.head_commit.message }}"}}'