Skip to content

Commit f3c7767

Browse files
authored
Update publish workflows (#126)
* Add workflows * Add missing npm publish * Add some fixes
1 parent 89932b1 commit f3c7767

File tree

4 files changed

+133
-96
lines changed

4 files changed

+133
-96
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy Develop
2+
3+
env:
4+
APP_LOCATION: ''
5+
OUTPUT_LOCATION: 'packages/website/build'
6+
7+
on:
8+
push:
9+
branches: [main]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
deploy-dev:
16+
runs-on: ubuntu-latest
17+
name: Deploy to Dev Environment
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: true
23+
24+
- name: Deploy to Development
25+
uses: Azure/static-web-apps-deploy@v1
26+
with:
27+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_DEV_API_TOKEN }}
28+
repo_token: ${{ secrets.GITHUB_TOKEN }}
29+
output_location: ${{ env.OUTPUT_LOCATION }}
30+
app_location: ${{ env.APP_LOCATION }}
31+
app_build_command: 'pnpm website build'
32+
action: 'upload'
33+
skip_api_build: true
34+
deployment_environment: 'dev'
35+
env:
36+
CUSTOM_BUILD_COMMAND: npm i -g corepack@latest && corepack prepare && pnpm install --frozen-lockfile && pnpm ui build && pnpm website build
37+
ENABLE_NODE_MONOREPO_BUILD: true
38+
NODE_VERSION: 22

.github/workflows/deploy-docs.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.
Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,47 @@
1-
name: Publish @synergycodes/axiom package to NPM
1+
name: Deploy Production
2+
3+
env:
4+
APP_LOCATION: ''
5+
OUTPUT_LOCATION: 'packages/website/build'
26

37
on:
48
push:
5-
branches:
6-
- main
9+
branches: ['release/*']
10+
11+
permissions:
12+
contents: read
713

814
jobs:
9-
publish:
15+
deploy-production:
1016
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
node-version: [22]
14-
permissions:
15-
contents: read
16-
packages: write
17-
17+
name: Deploy to Production
1818
steps:
19-
- name: Checkout repo
19+
- name: Checkout code
2020
uses: actions/checkout@v4
2121
with:
22-
fetch-depth: 2
22+
submodules: true
2323

24-
- name: Install pnpm
25-
uses: pnpm/action-setup@v4
26-
27-
- name: Use Node.js ${{ matrix.node-version }}
24+
- name: Set up Node.js
2825
uses: actions/setup-node@v4
2926
with:
30-
node-version: ${{ matrix.node-version }}
31-
cache: 'pnpm'
27+
node-version: 22
28+
registry-url: 'https://registry.npmjs.org'
29+
30+
- name: Enable Corepack
31+
run: npm i -g corepack@latest
32+
33+
- name: Install pnpm
34+
run: corepack prepare
3235

3336
- name: Install dependencies
3437
run: pnpm install --frozen-lockfile
3538

39+
- name: Build UI Package
40+
run: pnpm ui build
41+
42+
- name: Build Documentation
43+
run: pnpm website build
44+
3645
- name: Read versions
3746
id: version-check
3847
run: |
@@ -66,3 +75,19 @@ jobs:
6675
fi
6776
env:
6877
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
78+
79+
- name: Deploy Documentation to Production
80+
uses: Azure/static-web-apps-deploy@v1
81+
with:
82+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_PROD_API_TOKEN }}
83+
repo_token: ${{ secrets.GITHUB_TOKEN }}
84+
output_location: ${{ env.OUTPUT_LOCATION }}
85+
app_location: ${{ env.APP_LOCATION }}
86+
app_build_command: 'pnpm website build'
87+
action: 'upload'
88+
skip_api_build: true
89+
deployment_environment: 'release'
90+
env:
91+
CUSTOM_BUILD_COMMAND: corepack enable && corepack prepare [email protected] --activate && pnpm install --frozen-lockfile && pnpm ui build && pnpm website build
92+
ENABLE_NODE_MONOREPO_BUILD: true
93+
NODE_VERSION: 22

.github/workflows/validate-pr.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Validate PR
2+
3+
env:
4+
APP_LOCATION: ''
5+
OUTPUT_LOCATION: 'packages/website/build'
6+
7+
on:
8+
pull_request:
9+
branches: [main, 'release/*']
10+
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
15+
jobs:
16+
validate:
17+
runs-on: ubuntu-latest
18+
name: Validate PR
19+
env:
20+
ENABLE_NODE_MONOREPO_BUILD: true
21+
NODE_VERSION: 22
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ env.NODE_VERSION }}
30+
31+
- name: Enable Corepack
32+
run: npm i -g corepack@latest
33+
34+
- name: Install pnpm
35+
run: corepack prepare
36+
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile
39+
40+
- name: Build UI Package
41+
run: pnpm ui build
42+
43+
- name: Build Documentation
44+
run: pnpm website build
45+
46+
- name: Run Quality Checks
47+
run: |
48+
pnpm lint:fix
49+
pnpm format
50+
pnpm typecheck
51+
pnpm file-lint

0 commit comments

Comments
 (0)