Update docs-gh-pages.yml

This commit is contained in:
Nuno Coração 2022-09-11 20:52:49 +01:00 committed by GitHub
parent d44da47b0b
commit 533075192d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,54 +1,36 @@
name: Deploy Docs to GitHub Pages name: GitHub Pages
on: on:
# Runs on pushes targeting the default branch
push: push:
branches: ["main"] 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
jobs: jobs:
# Build job build-deploy:
build: name: Build and Deploy
runs-on: ubuntu-latest runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps: steps:
- name: Hugo setup
uses: peaceiris/actions-hugo@v2.4.12
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
- name: Build - name: Build
run: hugo --source exampleSite --themesDir ../.. -d docs working-directory: ./exampleSite
run: hugo --minify --themesDir ../.. --buildDrafts --baseURL https://nunocoracao.github.io/blowfish/
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./exampleSite/docs
# Deployment job - name: Deploy
deploy: uses: peaceiris/actions-gh-pages@v3
environment: if: ${{ github.ref == 'refs/heads/stable' }}
name: github-pages with:
url: ${{ steps.deployment.outputs.page_url }} github_token: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest publish_branch: gh-pages
needs: build publish_dir: ./exampleSite/public
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1