| 1 |
name: Deploy Documentation to Github Pages |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
|
| 8 |
|
| 9 |
workflow_dispatch: |
| 10 |
|
| 11 |
|
| 12 |
permissions: |
| 13 |
contents: read |
| 14 |
pages: write |
| 15 |
id-token: write |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
concurrency: |
| 20 |
group: "pages" |
| 21 |
cancel-in-progress: false |
| 22 |
|
| 23 |
|
| 24 |
defaults: |
| 25 |
run: |
| 26 |
shell: bash |
| 27 |
|
| 28 |
jobs: |
| 29 |
|
| 30 |
build: |
| 31 |
runs-on: ubuntu-latest |
| 32 |
env: |
| 33 |
HUGO_VERSION: 0.115.4 |
| 34 |
steps: |
| 35 |
- name: Install Hugo CLI |
| 36 |
run: | |
| 37 |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ |
| 38 |
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb |
| 39 |
|
| 40 |
|
| 41 |
- name: Checkout |
| 42 |
uses: actions/checkout@v3 |
| 43 |
with: |
| 44 |
submodules: recursive |
| 45 |
fetch-depth: 0 |
| 46 |
- name: Setup Pages |
| 47 |
id: pages |
| 48 |
uses: actions/configure-pages@v3 |
| 49 |
- name: Install Node.js dependencies |
| 50 |
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" |
| 51 |
working-directory: ./docs |
| 52 |
- name: Build with Hugo |
| 53 |
env: |
| 54 |
|
| 55 |
HUGO_ENVIRONMENT: production |
| 56 |
HUGO_ENV: production |
| 57 |
run: | |
| 58 |
hugo \ |
| 59 |
--gc \ |
| 60 |
--minify \ |
| 61 |
--baseURL "${{ steps.pages.outputs.base_url }}/" |
| 62 |
working-directory: ./docs |
| 63 |
- name: Upload artifact |
| 64 |
uses: actions/upload-pages-artifact@v1 |
| 65 |
with: |
| 66 |
path: ./docs/public |
| 67 |
|
| 68 |
|
| 69 |
deploy: |
| 70 |
environment: |
| 71 |
name: github-pages |
| 72 |
url: ${{ steps.deployment.outputs.page_url }} |
| 73 |
runs-on: ubuntu-latest |
| 74 |
needs: build |
| 75 |
steps: |
| 76 |
- name: Deploy to GitHub Pages |
| 77 |
id: deployment |
| 78 |
uses: actions/deploy-pages@v2 |