Files
docker_practice/.github/workflows/release-pdf.yml
dependabot[bot] 607a67888a chore(deps): bump the dependencies group with 2 updates
Bumps the dependencies group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/upload-artifact](https://github.com/actions/upload-artifact).


Updates `actions/checkout` from 4 to 6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

Updates `actions/upload-artifact` from 4 to 7
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dependencies
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-25 18:46:02 +00:00

49 lines
1.3 KiB
Go

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@v6
- 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@v7
with:
name: docker_practice-pdf
path: docker_practice.pdf