Skip to content

Commit 6f5ca73

Browse files
Merge pull request #2795 from OctopusDeploy/sf/docs-thin-package
Thin packages
2 parents 2bbcf07 + d1ccb24 commit 6f5ca73

File tree

34 files changed

+904
-391
lines changed

34 files changed

+904
-391
lines changed

.github/workflows/branch-spellcheck.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- name: Install pnpm
2525
uses: pnpm/action-setup@v4
2626
with:
27+
version: 10.13.1
2728
run_install: false
2829

2930
- name: Setup Node
@@ -33,6 +34,19 @@ jobs:
3334
cache: 'pnpm'
3435
cache-dependency-path: 'pnpm-lock.yaml'
3536

37+
- name: Get pnpm store directory
38+
shell: bash
39+
run: |
40+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
41+
42+
- uses: actions/cache@v3
43+
name: Setup pnpm cache
44+
with:
45+
path: ${{ env.STORE_PATH }}
46+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
47+
restore-keys: |
48+
${{ runner.os }}-pnpm-store-
49+
3650
- name: PNPM install
3751
run: |
3852
echo; echo "cd to workspace"
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Deploy to Channel Full Refresh
2+
3+
on:
4+
workflow_dispatch:
5+
6+
# Allow this job to clone the repo and create a page deployment
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
branch_tests:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: true
21+
22+
env:
23+
SHOULD_DEPLOY: ${{ secrets.OCTOPUSSERVERURL != '' || '' }}
24+
OCTOPUS_URL: ${{ secrets.OCTOPUSSERVERURL }}
25+
OCTOPUS_API_KEY: ${{ secrets.OCTOPUSSERVERAPIKEY }}
26+
OCTOPUS_SPACE: "DevOps Microsite"
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Install pnpm
33+
uses: pnpm/action-setup@v4
34+
with:
35+
version: 10.13.1
36+
run_install: false
37+
38+
- name: Setup Node
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 18
42+
cache: 'pnpm'
43+
cache-dependency-path: 'pnpm-lock.yaml'
44+
45+
- name: Get pnpm store directory
46+
shell: bash
47+
run: |
48+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
49+
50+
- uses: actions/cache@v3
51+
name: Setup pnpm cache
52+
with:
53+
path: ${{ env.STORE_PATH }}
54+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
55+
restore-keys: |
56+
${{ runner.os }}-pnpm-store-
57+
58+
- name: PNPM and Playwright install
59+
run: |
60+
echo; echo "cd to workspace"
61+
cd $GITHUB_WORKSPACE
62+
echo; echo "listing"
63+
ls
64+
echo; echo "NPM install"
65+
pnpm install
66+
67+
- name: Astro build and test
68+
run: |
69+
export NODE_OPTIONS=--max_old_space_size=4096
70+
pnpm dev:img
71+
pnpm test
72+
pnpm crawl
73+
74+
- name: Set Version
75+
run: |
76+
echo "PACKAGE_VERSION=$(date +'%Y.%m.%d').$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
77+
78+
- name: Check output
79+
run: |
80+
echo; echo "cd to workspace"
81+
cd $GITHUB_WORKSPACE
82+
echo; echo "listing"
83+
ls
84+
85+
- name: Create a Zip package 🐙
86+
id: package
87+
uses: OctopusDeploy/create-zip-package-action@v3
88+
with:
89+
package_id: 'DocsMicrosite'
90+
version: "${{ env.PACKAGE_VERSION }}-pullrequest.full"
91+
base_path: "./dist"
92+
output_folder: "./artifacts"
93+
files: |
94+
**/*.*
95+
96+
- name: Push a package to Octopus Deploy 🐙
97+
uses: OctopusDeploy/[email protected]
98+
if: ${{ env.SHOULD_DEPLOY }}
99+
with:
100+
packages: ${{ steps.package.outputs.package_file_path }}
101+
102+
- name: Let people download package
103+
uses: actions/upload-artifact@v4
104+
if: ${{ ! env.SHOULD_DEPLOY }}
105+
with:
106+
name: docs-microsite
107+
path: ${{ steps.package.outputs.package_file_path }}
108+
109+
- name: Push build information to Octopus Deploy 🐙
110+
uses: OctopusDeploy/push-build-information-action@v3
111+
if: ${{ env.SHOULD_DEPLOY }}
112+
with:
113+
version: "${{ env.PACKAGE_VERSION }}-pullrequest.full"
114+
packages: ${{ steps.package.outputs.package_file_path }}
115+
116+
- name: Create a release in Octopus Deploy 🐙
117+
id: "create_release"
118+
uses: OctopusDeploy/create-release-action@v3
119+
if: ${{ env.SHOULD_DEPLOY }}
120+
with:
121+
project: "Docs Microsite"
122+
package_version: "${{ env.PACKAGE_VERSION }}-pullrequest.full"
123+
git_ref: ${{ github.ref }}

.github/workflows/branch-validation.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
SHOULD_DEPLOY: ${{ secrets.OCTOPUSSERVERURL != '' || '' }}
2323
OCTOPUS_URL: ${{ secrets.OCTOPUSSERVERURL }}
2424
OCTOPUS_API_KEY: ${{ secrets.OCTOPUSSERVERAPIKEY }}
25-
OCTOPUS_SPACE: 'DevOps Microsite'
25+
OCTOPUS_SPACE: "DevOps Microsite"
2626

2727
steps:
2828
- name: Checkout
@@ -31,6 +31,7 @@ jobs:
3131
- name: Install pnpm
3232
uses: pnpm/action-setup@v4
3333
with:
34+
version: 10.13.1
3435
run_install: false
3536

3637
- name: Setup Node
@@ -40,6 +41,19 @@ jobs:
4041
cache: 'pnpm'
4142
cache-dependency-path: 'pnpm-lock.yaml'
4243

44+
- name: Get pnpm store directory
45+
shell: bash
46+
run: |
47+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
48+
49+
- uses: actions/cache@v3
50+
name: Setup pnpm cache
51+
with:
52+
path: ${{ env.STORE_PATH }}
53+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
54+
restore-keys: |
55+
${{ runner.os }}-pnpm-store-
56+
4357
- name: PNPM and Playwright install
4458
run: |
4559
echo; echo "cd to workspace"
@@ -54,7 +68,8 @@ jobs:
5468
export NODE_OPTIONS=--max_old_space_size=4096
5569
pnpm dev:img
5670
pnpm test
57-
node ./src/themes/octopus/utilities/page-report.js
71+
pnpm crawl
72+
pnpm thin
5873
5974
- name: Set Version
6075
run: |
@@ -72,9 +87,9 @@ jobs:
7287
uses: OctopusDeploy/create-zip-package-action@v3
7388
with:
7489
package_id: 'DocsMicrosite'
75-
version: '${{ env.PACKAGE_VERSION }}-pullrequest'
76-
base_path: './dist'
77-
output_folder: './artifacts'
90+
version: "${{ env.PACKAGE_VERSION }}-pullrequest"
91+
base_path: "./dist"
92+
output_folder: "./artifacts"
7893
files: |
7994
**/*.*
8095
@@ -95,14 +110,14 @@ jobs:
95110
uses: OctopusDeploy/push-build-information-action@v3
96111
if: ${{ env.SHOULD_DEPLOY }}
97112
with:
98-
version: '${{ env.PACKAGE_VERSION }}-pullrequest'
113+
version: "${{ env.PACKAGE_VERSION }}-pullrequest"
99114
packages: ${{ steps.package.outputs.package_file_path }}
100115

101116
- name: Create a release in Octopus Deploy 🐙
102-
id: 'create_release'
117+
id: "create_release"
103118
uses: OctopusDeploy/create-release-action@v3
104119
if: ${{ env.SHOULD_DEPLOY }}
105120
with:
106-
project: 'Docs Microsite'
107-
package_version: '${{ env.PACKAGE_VERSION }}-pullrequest'
121+
project: "Docs Microsite"
122+
package_version: "${{ env.PACKAGE_VERSION }}-pullrequest"
108123
git_ref: ${{ github.ref }}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Deploy Full Refresh
2+
3+
on:
4+
workflow_dispatch:
5+
6+
# Allow this job to clone the repo and create a page deployment
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build_and_deploy:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: true
21+
22+
env:
23+
SHOULD_DEPLOY: ${{ secrets.OCTOPUSSERVERURL != '' || '' }}
24+
OCTOPUS_URL: ${{ secrets.OCTOPUSSERVERURL }}
25+
OCTOPUS_API_KEY: ${{ secrets.OCTOPUSSERVERAPIKEY }}
26+
OCTOPUS_SPACE: "DevOps Microsite"
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Install pnpm
33+
uses: pnpm/action-setup@v4
34+
with:
35+
version: 10.13.1
36+
run_install: false
37+
38+
- name: Setup Node
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 18
42+
cache: 'pnpm'
43+
cache-dependency-path: 'pnpm-lock.yaml'
44+
45+
- name: Get pnpm store directory
46+
shell: bash
47+
run: |
48+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
49+
50+
- uses: actions/cache@v3
51+
name: Setup pnpm cache
52+
with:
53+
path: ${{ env.STORE_PATH }}
54+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
55+
restore-keys: |
56+
${{ runner.os }}-pnpm-store-
57+
58+
- name: PNPM and Playwright install
59+
run: |
60+
echo; echo "cd to workspace"
61+
cd $GITHUB_WORKSPACE
62+
echo; echo "listing"
63+
ls
64+
echo; echo "PNPM install"
65+
pnpm install
66+
67+
- name: Astro build and test
68+
run: |
69+
export NODE_OPTIONS=--max_old_space_size=4096
70+
pnpm dev:img
71+
pnpm test
72+
pnpm crawl
73+
74+
- name: Set Version
75+
run: |
76+
echo "PACKAGE_VERSION=$(date +'%Y.%m.%d').$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
77+
78+
- name: Check output
79+
run: |
80+
echo; echo "cd to workspace"
81+
cd $GITHUB_WORKSPACE
82+
echo; echo "listing"
83+
ls
84+
85+
- name: Create a Zip package 🐙
86+
id: package
87+
uses: OctopusDeploy/create-zip-package-action@v3
88+
with:
89+
package_id: 'DocsMicrosite'
90+
version: "${{ env.PACKAGE_VERSION }}-full"
91+
base_path: "./dist"
92+
output_folder: "./artifacts"
93+
files: |
94+
**/*.*
95+
96+
- name: Push a package to Octopus Deploy 🐙
97+
uses: OctopusDeploy/[email protected]
98+
if: ${{ env.SHOULD_DEPLOY }}
99+
with:
100+
packages: ${{ steps.package.outputs.package_file_path }}
101+
102+
- name: Let people download package
103+
uses: actions/upload-artifact@v4
104+
if: ${{ ! env.SHOULD_DEPLOY }}
105+
with:
106+
name: docs-microsite
107+
path: ${{ steps.package.outputs.package_file_path }}
108+
109+
- name: Push build information to Octopus Deploy 🐙
110+
uses: OctopusDeploy/push-build-information-action@v3
111+
if: ${{ env.SHOULD_DEPLOY }}
112+
with:
113+
version: "${{ env.PACKAGE_VERSION }}-full"
114+
packages: ${{ steps.package.outputs.package_file_path }}
115+
116+
- name: Create a release in Octopus Deploy 🐙
117+
id: "create_release"
118+
uses: OctopusDeploy/create-release-action@v3
119+
if: ${{ env.SHOULD_DEPLOY }}
120+
with:
121+
project: "Docs Microsite"
122+
package_version: "${{ env.PACKAGE_VERSION }}-full"
123+
git_ref: ${{ github.ref }}

0 commit comments

Comments
 (0)