mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 08:27:25 +00:00
ci: add auto-release.yml, remove release-pdf.yml, limit CI trigger to master
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Build PDF on Release
|
name: Auto Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -10,12 +10,10 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-pdf:
|
release:
|
||||||
name: Generate PDF
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v6
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Install Chromium and CJK fonts
|
- name: Install Chromium and CJK fonts
|
||||||
run: |
|
run: |
|
||||||
@@ -27,9 +25,9 @@ jobs:
|
|||||||
LATEST_TAG=$(curl -fsSL -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ github.token }}" https://api.github.com/repos/yeasy/mdpress/releases/latest | jq -r .tag_name)
|
LATEST_TAG=$(curl -fsSL -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ github.token }}" https://api.github.com/repos/yeasy/mdpress/releases/latest | jq -r .tag_name)
|
||||||
VERSION="${LATEST_TAG#v}"
|
VERSION="${LATEST_TAG#v}"
|
||||||
echo "Installing mdpress $VERSION"
|
echo "Installing mdpress $VERSION"
|
||||||
curl -fsSL "https://github.com/yeasy/mdPress/releases/download/$LATEST_TAG/mdpress_${VERSION}_linux_amd64.tar.gz" -o mdpress.tar.gz
|
curl -fsSL "https://github.com/yeasy/mdPress/releases/download/$LATEST_TAG/mdpress_${VERSION}_linux_amd64.tar.gz" -o /tmp/mdpress.tar.gz
|
||||||
tar xzf mdpress.tar.gz
|
tar xzf /tmp/mdpress.tar.gz -C /tmp mdpress
|
||||||
sudo mv mdpress /usr/local/bin/
|
sudo mv /tmp/mdpress /usr/local/bin/
|
||||||
mdpress --version
|
mdpress --version
|
||||||
|
|
||||||
- name: Extract tag name
|
- name: Extract tag name
|
||||||
@@ -39,7 +37,7 @@ jobs:
|
|||||||
- name: Build PDF
|
- name: Build PDF
|
||||||
run: mdpress build --format pdf --output docker_practice-${{ steps.tag.outputs.TAG_NAME || 'latest' }}.pdf
|
run: mdpress build --format pdf --output docker_practice-${{ steps.tag.outputs.TAG_NAME || 'latest' }}.pdf
|
||||||
|
|
||||||
- name: Create Release and upload PDF
|
- name: Create Release with PDF
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
@@ -2,6 +2,8 @@ name: CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user