Fix bashism #35
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: | |
branches: ["main"] | |
schedule: | |
# While we don't have hooks triggering this from riot-sys etc, a cron job | |
# is the next best thing | |
- cron: '0 4 * * *' | |
jobs: | |
build-docs: | |
runs-on: ubuntu-latest | |
container: riot/riotbuild | |
steps: | |
- name: Check out rust-documentation-builder | |
uses: actions/checkout@v4 | |
- name: Run `make build-from-checkout` | |
# Note that this runs the RIOT checkout internally, both to reduce | |
# dependencies on GitHub actions and to gain the flexibility on running | |
# with different sources with the same ease locally and in CI. | |
run: | | |
sh ./build-with-checkouts.sh | |
# We might use artifacts in other situations, but right now we only care | |
# about uploading. Could be useful for pull requests, but this would best | |
# work with HTML being served from the artifact. | |
# | |
# - name: Create artifact of built documentation | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: rustdoc | |
# path: bin/nrf52840dongle/target/thumbv7em-none-eabihf/doc/ | |
- name: Upload generated documentation | |
env: | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
SECRET_PORT: ${{ secrets.SECRET_PORT }} | |
run: | | |
# Beware that SSH uses /root and not ~ = ${HOME} = /github/home/ as | |
# documented on https://bugzilla.mindrot.org/show_bug.cgi?id=3048 | |
mkdir /root/.ssh -m 0700 | |
echo "[tatooine.riot-os.org]:${SECRET_PORT} ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHvjwPa7KJNZS47cHXaMrxRcDj1a/2VEFtp041ZOSY2L" > /root/.ssh/known_hosts | |
echo "${SECRET_KEY}" > /root/.ssh/id_ed25519 | |
chmod go-rwx /root/.ssh/id_ed25519 | |
# Our key has rrsync as its command, so what is given as / is | |
# actually /var/www/doc.riot-os.org_rustdoc/latest/ | |
# | |
# Not doing full -a because we don't need -lpgoD, and don't want -t | |
# as to a) not needlessly modify metadata, and b) so that the file | |
# change information (admittedly not very accessible in most | |
# browsers) stays accurate. | |
# | |
# --delete-after ensures that static.files/search-${SOMEHEX} remains | |
# accessible until the last file is refreshed -- otherwise, newer | |
# HTML files can get into an endless self-refresh loop during a | |
# transmission, or (worse) when an upload was aborted. (The presence | |
# of that hash sadly also means that the excluded `-t` above won't be | |
# much help, as the files change all the time anyway -- still, at | |
# least we don't change the time on a complete no-op rsync when | |
# hopefully the hash is stable). | |
rsync -e "ssh -p${SECRET_PORT}" -vr --delete --delete-after bin/nrf52840dongle/target/thumbv7em-none-eabihf/doc/* [email protected]:/ |