docs: Add preset file locations. Fixes #109 #255
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
handle_forks: | |
name: Forked Repo | |
runs-on: ubuntu-latest | |
if: github.repository != 'HandBrake/HandBrake-docs' | |
steps: | |
- name: Print Warning | |
run: | | |
echo "Builds are disabled for forked repositories." | |
build: | |
name: Build on Ubuntu | |
runs-on: ubuntu-latest | |
if: github.repository == 'HandBrake/HandBrake-docs' | |
steps: | |
- uses: actions/checkout@master | |
- name: Toolchain Cache | |
id: build-toolchain | |
uses: actions/cache@v4 | |
with: | |
path: tools/local | |
key: build-toolchain | |
- name: Build Toolchain | |
if: steps.build-toolchain.outputs.cache-hit != 'true' | |
run: | | |
git submodule update --init | |
./build-tools | |
ls -la | |
- name: Build | |
run: | | |
bash ./marsh build --markdown="tools/local/bin/markdown" | |
gitrev=$(git rev-parse --short HEAD) | |
cd public | |
tar cvzf HandBrake_Documentation.$gitrev.tar.gz docs | |
zip -r HandBrake_Documentation.$gitrev.zip docs | |
cp *.tar.gz ../ | |
cp *.zip ../ | |
cd .. | |
- uses: actions/upload-artifact@master | |
with: | |
name: docs | |
path: | | |
HandBrake_Documentation*.tar.gz | |
HandBrake_Documentation*.zip | |
publish: | |
name: Publish Documentation | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.repository == 'HandBrake/HandBrake-docs' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Artifacts - Documentation | |
uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
path: docs/ | |
# Generate Hashes | |
- name: Generate SHA265 Hashes | |
run: | | |
cd docs | |
sha256sum * > sha256.txt | |
cp sha256.txt ../.github/workflows/ | |
cd .. | |
cd .github/workflows/ | |
sed -e 's/ / | /' -i sha256.txt | |
sed -e 's/^/| /' -i sha256.txt | |
sed -e 's/$/ |/' -i sha256.txt | |
cat sha256.txt >> rel_body.md | |
# Publishing the Release | |
- name: Remove the old Release | |
uses: dev-drprasad/[email protected] | |
with: | |
keep_latest: 0 | |
delete_tag_pattern: "docs" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "docs/*.*" | |
name: "Documentation" | |
bodyFile: .github/workflows/rel_body.md | |
prerelease: false | |
replacesArtifacts: false | |
allowUpdates: false | |
tag: docs | |
token: ${{ secrets.GITHUB_TOKEN }} |