From 3b1428199f49339d5aa8a607cd0f496907fcb2e5 Mon Sep 17 00:00:00 2001 From: Mo Gorhom Date: Thu, 26 Aug 2021 21:08:05 +0100 Subject: [PATCH] docs: added auto-deployment for documentation website --- .github/workflows/documentation.yml | 56 +++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 000000000..b61069a6f --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,56 @@ +name: documentation + +on: + pull_request: + branches: + - website + push: + branches: + - website + +jobs: + checks: + if: github.event_name != 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14' + - name: Test Build + run: | + if [ -e yarn.lock ]; then + yarn install --frozen-lockfile + elif [ -e package-lock.json ]; then + npm ci + else + npm i + fi + npm run build + deploy: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14' + - uses: webfactory/ssh-agent@v0.5.0 + with: + ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }} + - name: Release to GitHub Pages + env: + USE_SSH: true + GIT_USER: git + CURRENT_BRANCH: website + run: | + git config --global user.email "gorhom@me.com" + git config --global user.name "gorhom" + if [ -e yarn.lock ]; then + yarn install --frozen-lockfile + elif [ -e package-lock.json ]; then + npm ci + else + npm i + fi + npm run deploy \ No newline at end of file