mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-24 18:55:31 +00:00
fix: update docker-compose V1 syntax to V2 and add release PDF workflow
Replace remaining docker-compose command references with docker compose (V2). Add GitHub Actions workflow to auto-generate PDF via mdpress on release.
This commit is contained in:
48
.github/workflows/release-pdf.yml
vendored
Normal file
48
.github/workflows/release-pdf.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Build PDF on Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build-pdf:
|
||||
name: Generate PDF
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Chromium
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y chromium-browser
|
||||
|
||||
- name: Install mdpress (latest)
|
||||
run: |
|
||||
LATEST_TAG=$(curl -fsSL https://api.github.com/repos/yeasy/mdpress/releases/latest | jq -r .tag_name)
|
||||
VERSION="${LATEST_TAG#v}"
|
||||
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
|
||||
tar xzf mdpress.tar.gz
|
||||
sudo mv mdpress /usr/local/bin/
|
||||
mdpress --version
|
||||
|
||||
- name: Build PDF
|
||||
run: mdpress build --format pdf --output docker_practice.pdf
|
||||
|
||||
- name: Upload PDF to Release
|
||||
if: github.event_name == 'release'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: docker_practice.pdf
|
||||
|
||||
- name: Upload PDF as artifact
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: docker_practice-pdf
|
||||
path: docker_practice.pdf
|
||||
Reference in New Issue
Block a user