Skip to content

Commit d1e0818

Browse files
Merge preview into main (pocket-id#135)
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
1 parent 6475eac commit d1e0818

File tree

284 files changed

+12056
-28907
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+12056
-28907
lines changed

.github/svelte-check-matcher.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "svelte-check",
5+
"pattern": [
6+
{
7+
"regexp": "^([^\\s].*):(\\d+):(\\d+)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3
11+
},
12+
{
13+
"regexp": "^\\s*(Error|Warning):\\s*(.*)\\s+\\((?:ts|js|svelte)\\)$",
14+
"severity": 1,
15+
"message": 2,
16+
"loop": false
17+
}
18+
]
19+
}
20+
]
21+
}

.github/workflows/build-pr-preview.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,39 @@ name: Build Pull Request Preview
22

33
on:
44
pull_request:
5-
types: [opened, synchronize]
5+
types: [opened, synchronize, reopened]
66
paths:
77
- 'src/**'
88
- 'docs/**'
99
- 'static/**'
10+
- 'scripts/**'
1011
- 'package.json'
11-
- 'sidebars.ts'
12-
- 'tsconfig.json'
13-
- 'docusaurus.config.ts'
12+
- 'pnpm-lock.yaml'
13+
- 'svelte.config.js'
14+
- '.github/workflows/build-pr-preview.yml'
1415

1516
jobs:
1617
build-preview:
17-
environment: Preview
18+
environment: pr-preview
1819
runs-on: ubuntu-latest
1920
steps:
2021
- name: Checkout
2122
uses: actions/checkout@v4
2223

23-
- name: Checkout pocket-id/pocket-id repo
24+
- name: Checkout pocket-id repo (for swagger generation)
2425
uses: actions/checkout@v4
2526
with:
2627
repository: pocket-id/pocket-id
2728
path: pocket-id
28-
29-
- uses: actions/setup-node@v4
30-
with:
31-
node-version: lts/*
32-
cache: 'npm'
33-
cache-dependency-path: package-lock.json
29+
ref: main
3430

3531
- name: Setup Go
3632
uses: actions/setup-go@v5
3733

3834
- name: Install swag
3935
run: go install github.com/swaggo/swag/cmd/swag@latest
4036

41-
- name: Generate Swagger docs
37+
- name: Generate swagger.yaml
4238
run: |
4339
cd pocket-id/backend
4440
swag init -d ./internal,./internal/dto -g ../cmd/main.go -ot yaml -o ../../static -md ../../static
@@ -48,21 +44,26 @@ jobs:
4844
chmod +x ./scripts/add-api-doc-tags.sh
4945
./scripts/add-api-doc-tags.sh
5046
51-
- name: Remove Pocket ID repo
47+
- name: Remove pocket-id repo
5248
run: rm -rf pocket-id
5349

54-
- name: Install dependencies
55-
run: npm install
50+
- name: Setup pnpm
51+
uses: pnpm/action-setup@v4
52+
with:
53+
version: 10
5654

57-
- name: Generate API docs with Docusaurus
58-
run: |
59-
npx docusaurus gen-api-docs all
55+
- name: Setup Node
56+
uses: actions/setup-node@v4
57+
with:
58+
node-version: 22
59+
cache: 'pnpm'
60+
cache-dependency-path: pnpm-lock.yaml
6061

6162
- name: Install dependencies
62-
run: npm install
63+
run: pnpm install --frozen-lockfile
6364

64-
- name: Build site
65-
run: npm run build
65+
- name: Build (SvelteKit)
66+
run: pnpm build
6667

6768
- name: Upload build artifact
6869
uses: actions/upload-artifact@v4

.github/workflows/deploy-pr-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ jobs:
3636
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
3737
githubToken: ${{ secrets.GITHUB_TOKEN }}
3838
projectName: pocket-id-website
39-
deploymentName: Preview
39+
deploymentName: pr-preview
4040
directory: ${{ steps.preview-build-artifact.outputs.download-path }}

.github/workflows/deploy-preview-branch.yml

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ on:
99
- 'src/**'
1010
- 'docs/**'
1111
- 'static/**'
12+
- 'scripts/**'
1213
- 'package.json'
13-
- 'sidebars.ts'
14-
- 'tsconfig.json'
15-
- 'docusaurus.config.ts'
14+
- 'pnpm-lock.yaml'
15+
- 'svelte.config.js'
16+
- '.github/workflows/deploy-preview-branch.yml'
1617

1718
permissions:
1819
actions: read
@@ -28,25 +29,20 @@ jobs:
2829
- name: Checkout
2930
uses: actions/checkout@v4
3031

31-
- name: Checkout pocket-id/pocket-id repo
32+
- name: Checkout pocket-id repo (for swagger generation)
3233
uses: actions/checkout@v4
3334
with:
3435
repository: pocket-id/pocket-id
3536
path: pocket-id
36-
37-
- uses: actions/setup-node@v4
38-
with:
39-
node-version: lts/*
40-
cache: 'npm'
41-
cache-dependency-path: package-lock.json
37+
ref: main
4238

4339
- name: Setup Go
4440
uses: actions/setup-go@v5
4541

4642
- name: Install swag
4743
run: go install github.com/swaggo/swag/cmd/swag@latest
4844

49-
- name: Generate Swagger docs
45+
- name: Generate swagger.yaml
5046
run: |
5147
cd pocket-id/backend
5248
swag init -d ./internal,./internal/dto -g ../cmd/main.go -ot yaml -o ../../static -md ../../static
@@ -56,21 +52,26 @@ jobs:
5652
chmod +x ./scripts/add-api-doc-tags.sh
5753
./scripts/add-api-doc-tags.sh
5854
59-
- name: Remove Pocket ID repo
55+
- name: Remove pocket-id repo
6056
run: rm -rf pocket-id
6157

62-
- name: Install dependencies
63-
run: npm install
58+
- name: Setup pnpm
59+
uses: pnpm/action-setup@v4
60+
with:
61+
version: 10
6462

65-
- name: Generate API docs with Docusaurus
66-
run: |
67-
npx docusaurus gen-api-docs all
63+
- name: Setup Node
64+
uses: actions/setup-node@v4
65+
with:
66+
node-version: 22
67+
cache: 'pnpm'
68+
cache-dependency-path: pnpm-lock.yaml
6869

6970
- name: Install dependencies
70-
run: npm install
71+
run: pnpm install --frozen-lockfile
7172

72-
- name: Build site
73-
run: npm run build
73+
- name: Build (SvelteKit)
74+
run: pnpm build
7475

7576
- name: Deploy to Cloudflare Pages
7677
uses: AdrianGonz97/refined-cf-pages-action@v1
@@ -80,5 +81,6 @@ jobs:
8081
githubToken: ${{ secrets.GITHUB_TOKEN }}
8182
projectName: pocket-id-website
8283
deploymentName: Preview
83-
directory: build
8484
branch: preview
85+
directory: build
86+
wranglerVersion: '3'
Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,45 @@
1+
name: Deploy Production Website
2+
13
on:
24
push:
3-
branches:
4-
- main
5+
branches: [main]
56
paths:
67
- 'src/**'
78
- 'docs/**'
89
- 'static/**'
910
- 'package.json'
10-
- 'sidebars.ts'
11-
- 'tsconfig.json'
12-
- 'docusaurus.config.ts'
11+
- 'pnpm-lock.yaml'
12+
- 'svelte.config.js'
13+
- '.github/workflows/deploy-production.yml'
14+
- 'scripts/**'
1315

1416
jobs:
15-
publish:
16-
runs-on: ubuntu-latest
17+
deploy:
18+
runs-on: macos-latest
1719
permissions:
18-
actions: read
19-
deployments: write
2020
contents: read
21-
name: Publish Production Website to Cloudflare Pages
21+
deployments: write
22+
actions: write
23+
pull-requests: write
24+
2225
steps:
2326
- name: Checkout
24-
uses: actions/checkout@v3
27+
uses: actions/checkout@v4
2528

26-
- name: Checkout pocket-id/pocket-id repo
29+
- name: Checkout pocket-id repo (for swagger generation)
2730
uses: actions/checkout@v4
2831
with:
2932
repository: pocket-id/pocket-id
3033
path: pocket-id
31-
32-
- uses: actions/setup-node@v4
33-
with:
34-
node-version: lts/*
35-
cache: 'npm'
36-
cache-dependency-path: package-lock.json
34+
ref: main
3735

3836
- name: Setup Go
3937
uses: actions/setup-go@v5
4038

4139
- name: Install swag
4240
run: go install github.com/swaggo/swag/cmd/swag@latest
4341

44-
- name: Generate Swagger docs
42+
- name: Generate swagger.yaml
4543
run: |
4644
cd pocket-id/backend
4745
swag init -d ./internal,./internal/dto -g ../cmd/main.go -ot yaml -o ../../static -md ../../static
@@ -51,30 +49,35 @@ jobs:
5149
chmod +x ./scripts/add-api-doc-tags.sh
5250
./scripts/add-api-doc-tags.sh
5351
54-
- name: Remove Pocket ID repo
52+
- name: Remove pocket-id repo
5553
run: rm -rf pocket-id
5654

57-
- name: Install dependencies
58-
run: npm install
55+
- name: Setup pnpm
56+
uses: pnpm/action-setup@v4
57+
with:
58+
version: 10
5959

60-
- name: Generate API docs with Docusaurus
61-
run: |
62-
npx docusaurus gen-api-docs all
60+
- name: Setup Node
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: 22
64+
cache: 'pnpm'
65+
cache-dependency-path: pnpm-lock.yaml
6366

6467
- name: Install dependencies
65-
run: npm install
68+
run: pnpm install --frozen-lockfile
6669

67-
- name: Build site
68-
run: npm run build
70+
- name: Build
71+
run: pnpm build
6972

70-
- name: Publish to Cloudflare Pages
73+
- name: Deploy to Cloudflare Pages
7174
uses: AdrianGonz97/refined-cf-pages-action@v1
7275
with:
7376
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
7477
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
7578
githubToken: ${{ secrets.GITHUB_TOKEN }}
7679
projectName: pocket-id-website
77-
directory: build
7880
deploymentName: Production
7981
branch: main
82+
directory: build
8083
wranglerVersion: '3'

.github/workflows/svelte-check.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Svelte Check
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'src/**'
8+
- 'static/**'
9+
- '.github/svelte-check-matcher.json'
10+
- 'package.json'
11+
- 'pnpm-lock.yaml'
12+
- 'tsconfig.json'
13+
- 'svelte.config.js'
14+
pull_request:
15+
branches: [main, preview]
16+
paths:
17+
- 'src/**'
18+
- 'static/**'
19+
- '.github/svelte-check-matcher.json'
20+
- 'package.json'
21+
- 'pnpm-lock.yaml'
22+
- 'tsconfig.json'
23+
- 'svelte.config.js'
24+
workflow_dispatch:
25+
26+
jobs:
27+
type-check:
28+
name: Run Svelte Check
29+
if: github.actor != 'dependabot[bot]'
30+
runs-on: ubuntu-latest
31+
permissions:
32+
contents: read
33+
checks: write
34+
pull-requests: write
35+
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v4
39+
40+
- name: Setup pnpm
41+
uses: pnpm/action-setup@v4
42+
with:
43+
version: 10
44+
45+
- name: Setup Node.js
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: 22
49+
cache: 'pnpm'
50+
cache-dependency-path: pnpm-lock.yaml
51+
52+
- name: Install dependencies
53+
run: pnpm install --frozen-lockfile
54+
55+
- name: Build (optional)
56+
run: pnpm build
57+
58+
- name: Add svelte-check problem matcher
59+
run: echo "::add-matcher::.github/svelte-check-matcher.json"
60+
61+
- name: Run svelte-check
62+
run: pnpm check

0 commit comments

Comments
 (0)