From 89c1e0df766123ac41513b8c20630e57c7d33b85 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 4 Oct 2020 23:32:57 +0200 Subject: [PATCH] ci: add GitHub Actions workflow 'site' --- .github/workflows/site.yml | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/site.yml diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml new file mode 100644 index 00000000..ad885e9f --- /dev/null +++ b/.github/workflows/site.yml @@ -0,0 +1,47 @@ +name: 'site' + +on: + push: + pull_request: + +jobs: + doc: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v3 + + - name: Get Hugo and Theme + run: | + curl -fsSL https://github.com/gohugoio/hugo/releases/download/v0.114.0/hugo_extended_0.114.0_Linux-64bit.tar.gz | sudo tar xzf - -C /usr/local/bin hugo + sudo chmod +x /usr/local/bin/hugo + mkdir -p site/themes + cd site/themes + git clone https://github.com/bep/docuapi + cd docuapi + npm install --only=dev + mv node_modules ../.. + + - name: Build site + run: | + cd site + hugo version + hugo + + - uses: actions/upload-artifact@v3 + with: + name: site + path: site/public + + - name: Publish site to gh-pages + if: github.event_name != 'pull_request' + run: | + cd site/public/ + touch .nojekyll + git init + cp ../../.git/config ./.git/config + git add . + git config --local user.email "push@gha" + git config --local user.name "GHA" + git commit -a -m "update ${{ github.sha }}" + git push -u origin +HEAD:gh-pages