Skip to content

Commit 784c702

Browse files
Add GroupDocs.Markdown workflow files
1 parent 94f9237 commit 784c702

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: reference.groupdocs.com(markdown)(Production)
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches: [ production ]
10+
paths:
11+
- 'content/sites/groupdocs/markdown/**'
12+
pull_request:
13+
branches: [ production ]
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
19+
jobs:
20+
# This workflow contains a single job called "build"
21+
build:
22+
# The type of runner that the job will run on
23+
runs-on: macos-latest
24+
25+
# Steps represent a sequence of tasks that will be executed as part of the job
26+
steps:
27+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
with:
31+
submodules: true # Fetch Hugo themes
32+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
33+
- name: Checkout theme repo
34+
uses: actions/checkout@main
35+
with:
36+
repository: groupdocs/api-theme
37+
token: ${{ secrets.REPO_TOKEN }}
38+
fetch-depth: 0
39+
path: themes/api-theme
40+
# Step 2 - Sets up the latest version of Hugo
41+
- name: Setup Hugo
42+
uses: peaceiris/actions-hugo@v2
43+
with:
44+
hugo-version: '0.97.3'
45+
extended: true
46+
- name: Install Dependicies1
47+
run: npm install -D --save autoprefixer
48+
- name: Install Dependicies2
49+
run: npm install -D --save postcss-cli
50+
51+
# Also specifies the theme we want to use
52+
- name: Build
53+
run: hugo --configDir config/sites/groupdocs/markdown --environment production --minify
54+
55+
- name: Deploy reference.groupdocs.com(markdown)(production) to S3
56+
run: hugo --configDir config/sites/groupdocs/markdown --environment production deploy --target "Production" --maxDeletes -1
57+
env:
58+
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
59+
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }}
60+
# Invalidate Cloudfront Home Page
61+
- name: invalidate
62+
uses: chetan/invalidate-cloudfront-action@v2
63+
env:
64+
DISTRIBUTION: ${{ secrets.AWS_DISTRIBUTION_PROD }}
65+
PATHS: /markdown/*
66+
AWS_REGION: 'us-west-2'
67+
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
68+
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }}
69+
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: reference2.groupdocs.com(markdown)(Stage)
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches: [ main ]
10+
paths:
11+
- 'content/sites/groupdocs/markdown/**'
12+
pull_request:
13+
branches: [ main ]
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
19+
jobs:
20+
# This workflow contains a single job called "build"
21+
build:
22+
# The type of runner that the job will run on
23+
runs-on: macos-latest
24+
25+
# Steps represent a sequence of tasks that will be executed as part of the job
26+
steps:
27+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
with:
31+
submodules: true # Fetch Hugo themes
32+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
33+
- name: Checkout theme repo
34+
uses: actions/checkout@main
35+
with:
36+
repository: groupdocs/api-theme
37+
token: ${{ secrets.REPO_TOKEN }}
38+
fetch-depth: 0
39+
path: themes/api-theme
40+
# Step 2 - Sets up the latest version of Hugo
41+
- name: Setup Hugo
42+
uses: peaceiris/actions-hugo@v2
43+
with:
44+
hugo-version: '0.97.3'
45+
extended: true
46+
- name: Install Dependicies1
47+
run: npm install -D --save autoprefixer
48+
- name: Install Dependicies2
49+
run: npm install -D --save postcss-cli
50+
51+
# Also specifies the theme we want to use
52+
- name: Build
53+
run: hugo --configDir config/sites/groupdocs/markdown --environment staging --minify
54+
55+
- name: Deploy reference2.groupdocs.com(markdown)(Stage) to S3
56+
run: hugo --configDir config/sites/groupdocs/markdown --environment staging deploy --target "Stage" --maxDeletes -1
57+
env:
58+
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
59+
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }}
60+
# Invalidate Cloudfront Home Page
61+
- name: invalidate
62+
uses: chetan/invalidate-cloudfront-action@v2
63+
env:
64+
DISTRIBUTION: ${{ secrets.AWS_DISTRIBUTION }}
65+
PATHS: /markdown/*
66+
AWS_REGION: 'us-west-2'
67+
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
68+
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }}
69+

0 commit comments

Comments
 (0)