Skip to content

Hugo (assembly - staging) #327

Hugo (assembly - staging)

Hugo (assembly - staging) #327

Workflow file for this run

name: Hugo (One Product)
run-name: Hugo (${{ github.event.inputs.product }} - ${{ github.event.inputs.environment }})
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
product:
description: Product
type: choice
options:
- home
- viewer
- conversion
- annotation
- classification
- comparison
- editor
- merger
- metadata
- parser
- rewriter
- signature
- total
- translation
- watermark
- assembly
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: ${{ github.event.inputs.product }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
configure_one_language: [en, de, el, es, fr, id, it, ja, pt, ru, zh, ko, tr, ar, th, fa, he, da, vi]
steps:
- uses: actions/checkout@v4
with:
repository: groupdocs-cloud/products.groupdocs.cloud
ref: ${{ github.event.inputs.branch }}
token: ${{ secrets.REPO_TOKEN }}
- run: brew install hugo
- uses: actions/setup-node@v4
- run: npm install
- run: npm run configure
- run: npm run pages
- name: Download content
run: wget http://products.groupdocs.cloud.s3-website.us-west-2.amazonaws.com/generated.zip
- name: Extract content
run: unzip generated.zip
- run: hugo --environment=${{ github.event.inputs.environment }}
- run: hugo deploy --environment=${{ github.event.inputs.environment }} --maxDeletes=0
- name: Invalidate cache
env:
ENVIRONMENT: ${{ github.event.inputs.environment }}
PRODUCT: ${{ github.event.inputs.product }}
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_EN="$BASE_URL/$PRODUCT/*"
URL_LANG="$BASE_URL/*/$PRODUCT/*"
curl --silent \
--output /dev/null \
-d "{\"website\":\"$URL_EN\"}" \
-H "Content-Type: application/json" \
-X POST "$API_ENDPOINT
curl --silent \
--output /dev/null \
-d "{\"website\":\"$URL_LANG"}" \
-H "Content-Type: application/json" \
-X POST "$API_ENDPOINT"