From 533075192dff1f57c8664c63ce62b0581b0a09fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Sun, 11 Sep 2022 20:52:49 +0100 Subject: [PATCH] Update docs-gh-pages.yml --- .github/workflows/docs-gh-pages.yml | 68 +++++++++++------------------ 1 file changed, 25 insertions(+), 43 deletions(-) diff --git a/.github/workflows/docs-gh-pages.yml b/.github/workflows/docs-gh-pages.yml index 5c0c260d..1a7ab62f 100644 --- a/.github/workflows/docs-gh-pages.yml +++ b/.github/workflows/docs-gh-pages.yml @@ -1,54 +1,36 @@ -name: Deploy Docs to GitHub Pages +name: GitHub Pages on: - # Runs on pushes targeting the default branch push: - branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow one concurrent deployment -concurrency: - group: "pages" - cancel-in-progress: true + branches: + - main jobs: - # Build job - build: - runs-on: ubuntu-latest + build-deploy: + name: Build and Deploy + runs-on: ubuntu-20.04 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} steps: - - - name: Hugo setup - uses: peaceiris/actions-hugo@v2.4.12 - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' - - name: Checkout uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: "latest" - name: Build - run: hugo --source exampleSite --themesDir ../.. -d docs - - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: ./exampleSite/docs + working-directory: ./exampleSite + run: hugo --minify --themesDir ../.. --buildDrafts --baseURL https://nunocoracao.github.io/blowfish/ - # Deployment job - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/stable' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: ./exampleSite/public