Skip to content

Build and Deploy (staging) #13

Build and Deploy (staging)

Build and Deploy (staging) #13

Workflow file for this run

name: Build and Deploy
run-name: Build and Deploy (${{ 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: main
required: true
jobs:
build:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
steps:
- uses: actions/checkout@v4
with:
repository: aspose/products.aspose.dev
ref: ${{ github.event.inputs.branch }}
token: ${{ secrets.REPO_TOKEN }}
- uses: actions/setup-node@v4
- run: npm install
- name: Clean
run: rm -rf .next
- run: npm run build
env:
BASE_URL: ${{ secrets.BASE_URL }}
GENDAT_URL: ${{ secrets.GENDAT_URL }}
GTM_ID: ${{ secrets.GTM_ID }}
NEXT_TELEMETRY_DISABLED: 1
NODE_OPTIONS: --max-old-space-size=5555
- name: Upload to S3
run: aws s3 sync ./out/ s3://${{ secrets.AWS_S3_BUCKET }} --cache-control public,max-age=97969,must-revalidate
env:
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 }}