diff options
Diffstat (limited to 'meson/.github/workflows/website.yml')
-rw-r--r-- | meson/.github/workflows/website.yml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/meson/.github/workflows/website.yml b/meson/.github/workflows/website.yml new file mode 100644 index 000000000..efb7fed7e --- /dev/null +++ b/meson/.github/workflows/website.yml @@ -0,0 +1,47 @@ +name: Update website + +concurrency: + group: mesonbuild.com + # We do NOT want `cancel-in-progress` here since only one website job + # should run at a time to avoid upload race condtions. + +on: + push: + branches: + - master + paths: + - docs/** + workflow_dispatch: + +jobs: + update_website: + env: + HAS_SSH_KEY: ${{ secrets.WEBSITE_PRIV_KEY != '' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install package + run: | + sudo apt-get -y install python3-pip ninja-build libjson-glib-dev + pip install meson hotdoc + - name: Setup SSH Keys and known_hosts + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + run: | + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add - <<< "${{ secrets.WEBSITE_PRIV_KEY }}" + if: env.HAS_SSH_KEY == 'true' + - name: Build website + run: | + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + cd docs + meson setup _build + ninja -C _build + - name: Update website + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + run: | + cd docs + ninja -C _build upload + if: env.HAS_SSH_KEY == 'true' |