Skip to content

Build site

Build site #101

Workflow file for this run

name: Build site
on:
schedule:
- cron: '0 13 * * *'
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
ref: master
- name: Install and Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true
- name: Build site
run: hugo --enableGitInfo --minify --gc --logLevel info --baseURL https://monal-im.org/
- name: Create tar archive
run: |
tar \
--dereference --hard-dereference \
--directory "public" \
-cvf "$RUNNER_TEMP/master_public.tar" \
--exclude=.git \
--exclude=.github \
.
- name: Upload tar archive to github pages
run: |
git config --local user.email "[email protected]"
git config --local user.name "Monal-IM-Push[BOT]"
git reset --hard
git checkout gh-pages
cp "$RUNNER_TEMP/master_public.tar" "master_public.tar"
git add master_public.tar
git commit -m "Add new master_public.tar"
git push