Skip to content

CAD-Staging

CAD-Staging #1

Workflow file for this run

name: CAD-Staging
on:
repository_dispatch:
types: [staging-complete]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout theme repo
uses: actions/checkout@main
with:
repository: Aspose/tutorials.aspose.com
token: ${{ secrets.REPO_TOKEN }}
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.135.0'
extended: true
- name: Install autoprefixer
run: npm install -D --save autoprefixer
- name: Install postcss-cli
run: npm install -D --save postcss-cli
- name: Find and replace url param in frontmatter
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "url:"
replace: "url_ignore:"
include: "_index.md"
- name: Find and replace domain name
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "tutorials.aspose.com"
replace: "tutorials2.aspose.com"
include: "_index.md"
- name: Find and replace image url domain
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "logoImageSrc=\"https://www.aspose.cloud/"
replace: "logoImageSrc=\"https://cms.admin.containerize.com/"
include: "_index.md"
- name: Build cad
run: hugo --config "configs/cad.toml" -c "content/cad" -b "https://tutorials2.aspose.com/cad" --cleanDestinationDir --minify
- name: Deploy cad to S3
run: hugo deploy --config "configs/cad.toml" --maxDeletes=-1 --target "staging" --force
env:
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }}
- name: Invalidate CloudFront
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.AWS_DISTRIBUTION_STAGE }}
PATHS: "/cad/*"
AWS_REGION: "us-west-2"
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }}