Drop use of sudo #56
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: Documentation | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Install dependencies | |
run: | | |
apt update | |
apt install -y build-essential sudo git wget curl python3-sphinx rsync | |
# install sugar-toolkit-gtk3 dependencies | |
apt install -y python-all-dev python3-all-dev libgtk-3-dev | |
apt install -y libgdk-pixbuf2.0-dev libsm-dev libice-dev librsvg2-dev | |
apt install -y libxfixes-dev libxi-dev libx11-dev gettext intltool | |
apt install -y libxml-parser-perl x11proto-core-dev libasound2-dev | |
apt install -y libgirepository1.0-dev linux-libc-dev gir1.2-sugarext-1.0 | |
# install python3 dependencies | |
apt install -y gir1.2-webkit2-4.1 python3-six python3-decorator | |
apt install -y python3-dateutil python3-gi-cairo gir1.2-telepathyglib-0.12 | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Create builduser | |
run: | | |
# A user is required so that the docs are not built as root | |
sudo useradd builduser -m # Create the builduser | |
sudo passwd -d builduser # Delete the buildusers password | |
printf 'builduser ALL=(ALL) ALL\n' | sudo tee -a /etc/sudoers | |
- name: Build documentation | |
run: | | |
sudo chown builduser:builduser . -R | |
sudo -u builduser ./ci/docs.sh | |
- name: Deploy 🚀 | |
uses: JamesIves/[email protected] | |
# build the documentation, but only deploy them when the PR | |
# gets merged | |
if: github.ref == 'refs/heads/master' | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: deploy # The folder the action should deploy. |