Skip to content

Commit

Permalink
CI: Use manual version instead of branch name in deployment path
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Apr 27, 2021
1 parent dd92a31 commit 59b608d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Build Manual
on:
pull_request:
push:
branches:
- "main"
- "[0-9]+.[0-9]+"

jobs:
build-html:
Expand Down Expand Up @@ -76,4 +79,8 @@ jobs:
run: sh build_pdf.sh
- name: Deploy PDF manuals to download server
if: github.event_name == 'push' && env.SSH_AUTH_SOCK != null
run: rsync -e ssh --partial-dir="${DESTDIR}/.tmp/${GITHUB_RUN_ID}" "$@" "[email protected]:${DESTDIR}/$(git rev-parse --abbrev-ref HEAD)"
run: rsync --verbose --recursive --checksum --times --delay-updates "build/pdf/" "${SSH_USER}@${SSH_HOST}:${DESTDIR}/"
env:
DESTDIR: public_html/downloads/manual
SSH_HOST: downloads-hostgator.mixxx.org
SSH_USER: mixxx
6 changes: 4 additions & 2 deletions build_pdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ NUM_LANGUAGES="$(printf '%s' "$LANGUAGES" | wc -w)"

i=1

mkdir -p build/pdf
OUTPUT_DIR="build/pdf/${VERSION}"
mkdir -p "${OUTPUT_DIR}"
for lang in $LANGUAGES
do
printf -- '----- Building language "%s"... [%d/%d] -----\n' "$lang" "$i" "$NUM_LANGUAGES"
Expand All @@ -31,6 +32,7 @@ do

sphinx-build -b latex source "${BUILDDIR}" ${SPHINXOPTS}
make -C "${BUILDDIR}" LATEXMKOPTS="${LATEXMKOPTS}" all-pdf >/dev/null
[ -e "${BUILDDIR}/Mixxx-Manual.pdf" ] && cp "${BUILDDIR}/Mixxx-Manual.pdf" "build/pdf/mixxx-manual-${VERSION}-${lang}.pdf"

[ -e "${BUILDDIR}/Mixxx-Manual.pdf" ] && cp "${BUILDDIR}/Mixxx-Manual.pdf" "${OUTPUT_DIR}/mixxx-manual-${VERSION}-${lang}.pdf"
i=$((i + 1))
done

0 comments on commit 59b608d

Please sign in to comment.