Skip to content

Update file(s) "/." from "aspose-tasks/Aspose.Tasks-API-References" #91

Update file(s) "/." from "aspose-tasks/Aspose.Tasks-API-References"

Update file(s) "/." from "aspose-tasks/Aspose.Tasks-API-References" #91

name: apireference.aspose.com(tasks)(Production)
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the production branch
push:
branches: [ production ]
paths:
- 'content/sites/aspose/tasks/**'
pull_request:
branches: [ production ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Checkout theme repo
uses: actions/checkout@main
with:
repository: Aspose/api-theme
token: ${{ secrets.REPO_TOKEN }}
fetch-depth: 0
path: themes/api-theme
# Step 2 - Sets up the latest version of Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.119.0'
extended: true
- name: Install Dependencies 1
run: npm install -D --save autoprefixer
- name: Install Dependencies 2
run: npm install -D --save postcss-cli
# Also specifies the theme we want to use
- name: Build
run: hugo --configDir config/sites/aspose/tasks --environment production --minify
- name: Deploy apireference.aspose.com(tasks)(Production) to S3
run: |
retries=2
count=0
until [ $count -ge $retries ]
do
hugo --configDir config/sites/aspose/tasks --environment production deploy --target "Production" --maxDeletes 0 && break
count=$((count+1))
echo "Retry #$count..."
sleep 10
done
env:
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }}
if: ${{ success() }}
# Invalidate Cloudfront Home Page
- name: Invalidate Cloudfront Cache
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.AWS_DISTRIBUTION_PROD }}
PATHS: /tasks/*
AWS_REGION: 'us-west-2'
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }}
if: ${{ success() }}
# Notify if deployment fails
- name: Notify Failure
if: failure()
run: |
echo "Deployment to S3 failed after multiple attempts. Please check the logs for details."
# You can also add steps here to send notifications to Slack, email, etc.