From 9dcd7489d2568a09619d84f391c882746a6f7d19 Mon Sep 17 00:00:00 2001 From: orphen Date: Wed, 22 May 2024 16:53:59 +0900 Subject: [PATCH] fix: fix docs CI workflow; build in MRs; build and deploy on master --- .github/workflows/docs.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a348d54a52..1f1db2fb77 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,18 +1,35 @@ name: Build and deploy GH Pages + on: push: branches: - master + pull_request: + branches: + - master jobs: build: runs-on: ubuntu-latest + if: github.ref != 'refs/heads/master' + steps: + - name: checkout + uses: actions/checkout@v4 + - name: build + uses: shalzz/zola-deploy-action@v0.18.0 + env: + BUILD_DIR: docs/ + BUILD_ONLY: true + + build_and_deploy: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' steps: - name: checkout - uses: actions/checkout@v3.0.0 + uses: actions/checkout@v4 - name: build_and_deploy - uses: shalzz/zola-deploy-action@v0.17.2 + uses: shalzz/zola-deploy-action@v0.18.0 env: PAGES_BRANCH: gh-pages BUILD_DIR: docs/ - TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}