Skip to content

Hugo

Hugo #142

Workflow file for this run

name: Hugo
on:
workflow_dispatch:
inputs:
environment:
description: 'Build environment'
type: environment
default: staging
required: true
branch:
description: 'Branch to checkout'
type: string
default: master
required: true
jobs:
build:
runs-on: macos-latest
environment: ${{ github.event.inputs.environment }}
env:
NODE_ENV: ${{ github.event.inputs.environment }}
NODE_OPTIONS: --max-old-space-size=11111
HUGO_ENVIRONMENT: ${{ github.event.inputs.environment }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
CONFIGURE_ONE_LANGUAGE: ${{ matrix.configure_one_language }}
CONFIGURE_ONE_PRODUCT: ${{ matrix.configure_one_product }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
configure_one_product:
- home
- viewer
- conversion
- annotation
- classification
- comparison
- editor
- merger
- metadata
- parser
- rewriter
- signature
- total
- translation
- watermark
- assembly
configure_one_language: [en, de, el, es, fr, id, it, ja, pt, ru, zh]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: groupdocs-cloud/products.groupdocs.cloud
ref: ${{ github.event.inputs.branch }}
token: ${{ secrets.REPO_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
#- name: Setup Hugo
# uses: peaceiris/actions-hugo@v2
# with:
# extended: true
- name: Install Node.js Dependencies
run: npm install
- name: Configure build environment
run: npm run configure
- name: Process pages
env:
MAX_PROCESS_PARALLEL_PAGES: 3333
run: npm run pages
- name: Build
run: ./node_modules/hugo-bin/vendor/hugo --environment=${{ github.event.inputs.environment }}
- name: Process Sitemaps
run: npm run sitemaps
- name: Deploy to ${{ github.event.inputs.environment }}
run: ./node_modules/hugo-bin/vendor/hugo deploy --environment=${{ github.event.inputs.environment }} --maxDeletes=0
- name: Invalidate cache
env:
ENVIRONMENT: ${{ github.event.inputs.environment }}
API_ENDPOINT: ${{ secrets.CACHE_INVALIDATION_API_ENDPOINT }}
run: |
BASE_URL="https://products-qa.groupdocs.cloud"
if [ "$ENVIRONMENT" = "production" ]; then
BASE_URL="https://products.groupdocs.cloud"
fi
URL="$BASE_URL/*"
curl --silent \
--output /dev/null \
-d "{\"website\":\"$URL\"}" \
-H "Content-Type: application/json" \
-X POST "$API_ENDPOINT