From 76ca731b8e03e4dad97a480372d0d97cfc1e815f Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Tue, 17 Aug 2021 09:46:19 +0800 Subject: [PATCH] deploy docs only on master branch --- .github/workflows/build-deploy-docs.yml | 36 +++++++++++++++++++++++++ .github/workflows/main-ci.yml | 29 -------------------- 2 files changed, 36 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/build-deploy-docs.yml diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml new file mode 100644 index 00000000..0e139b56 --- /dev/null +++ b/.github/workflows/build-deploy-docs.yml @@ -0,0 +1,36 @@ +name: Build Deploy Docs + +on: + push: + branches: + - master + +jobs: + build-deploy-docs: + if: github.repository == 'laradock/laradock' + runs-on: ubuntu-20.04 +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} + defaults: + run: + working-directory: ./DOCUMENTATION + steps: + - name: Checkout Source Code + uses: actions/checkout@v2 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: 'latest' + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + + - name: Build Hugo Site + run: hugo --minify + + - name: Deploy Hugo Site to Github Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: ./docs diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index 7b359784..c609956c 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -9,35 +9,6 @@ on: - cron: '0 0 * * 0' jobs: - build-deploy-docs: - if: github.repository == 'laradock/laradock' - runs-on: ubuntu-20.04 -# concurrency: -# group: ${{ github.workflow }}-${{ github.ref }} - defaults: - run: - working-directory: ./DOCUMENTATION - steps: - - name: Checkout Source Code - uses: actions/checkout@v2 - - - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 - with: - hugo-version: 'latest' - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - - - name: Build Hugo Site - run: hugo --minify - - - name: Deploy Hugo Site to Github Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: gh-pages - publish_dir: ./docs - build-php: # Don't trigger on schedule event when in a fork if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'laradock/laradock')