Files
docker_practice/.github/workflows/preview-pdf.yml
T
dependabot[bot]andGitHub 9058882b73 chore(deps): bump the dependencies group across 1 directory with 2 updates
Bumps the dependencies group with 2 updates in the / directory: [actions/checkout](https://github.com/actions/checkout) and [softprops/action-gh-release](https://github.com/softprops/action-gh-release).


Updates `actions/checkout` from 6 to 7
- [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/v6...v7)

Updates `softprops/action-gh-release` from 2 to 3
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dependencies
- dependency-name: softprops/action-gh-release
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-30 12:18:26 +00:00

91 lines
2.7 KiB
Go

name: Update Preview PDF
on:
push:
branches:
- master
workflow_dispatch:
permissions:
contents: write
concurrency:
group: preview-pdf
cancel-in-progress: true
jobs:
update-preview-pdf:
name: Update preview release
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v7
- name: Check project rules
run: python3 check_project_rules.py
- name: Check release metadata
run: npm test
- name: Install Chromium and CJK fonts
uses: browser-actions/setup-chrome@v2
with:
chrome-version: stable
- name: Install CJK fonts
run: |
sudo apt-get update
sudo apt-get install -y fonts-noto-cjk fonts-noto-cjk-extra
- name: Install mdpress 0.7.10
env:
MDPRESS_VERSION: "0.7.10"
MDPRESS_SHA256: "17e53e455996940bbbce64c69c43b3fb543f1501e03b74cf0434074efebd2db4"
run: |
archive="/tmp/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"
echo "Installing mdpress ${MDPRESS_VERSION}"
curl -fsSL "https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" -o "$archive"
echo "${MDPRESS_SHA256} $archive" | sha256sum -c -
tar xzf "$archive" -C /tmp mdpress
sudo mv /tmp/mdpress /usr/local/bin/
mdpress --version
- name: Build latest preview PDF
run: |
mkdir -p dist
mdpress build --format pdf --output dist/docker_practice.pdf
- name: Write release notes
run: |
cat > dist/release-notes.md <<EOF
Auto-updated preview PDF from \`${GITHUB_SHA::7}\`.
- Branch: \`${GITHUB_REF_NAME}\`
- Commit: https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}
- Run: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}
EOF
- name: Create preview release
run: |
gh release view preview-pdf >/dev/null 2>&1 || \
gh release create preview-pdf \
--title "Latest Preview PDF" \
--notes-file dist/release-notes.md \
--prerelease \
--latest=false \
--target "$GITHUB_SHA"
- name: Update preview release metadata
run: |
gh release edit preview-pdf \
--title "Latest Preview PDF" \
--notes-file dist/release-notes.md \
--prerelease \
--target "$GITHUB_SHA"
- name: Remove legacy preview asset
run: gh release delete-asset preview-pdf latest.pdf -y || true
- name: Upload preview PDF
run: gh release upload preview-pdf dist/docker_practice.pdf --clobber