Skip to content

Commit 0219749

Browse files
committed
ci: automate GitHub Pages deployment
1 parent 421fb1f commit 0219749

File tree

4 files changed

+105
-73
lines changed

4 files changed

+105
-73
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
# push:
8+
# branches:
9+
# - main
10+
11+
defaults:
12+
run:
13+
working-directory: ./website
14+
15+
jobs:
16+
build:
17+
name: Build Docusaurus
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 18
26+
cache: yarn
27+
28+
- name: Install prettier-plugin-java dependencies
29+
working-directory: ./packages/prettier-plugin-java
30+
run: yarn install --frozen-lockfile
31+
- name: Build prettier-plugin-java
32+
working-directory: ./packages/prettier-plugin-java
33+
run: yarn build
34+
35+
- name: Install dependencies
36+
run: yarn install --frozen-lockfile
37+
- name: Build website
38+
run: yarn build
39+
40+
- name: Check files
41+
run: ls -al
42+
43+
- name: Upload Build Artifact
44+
uses: actions/upload-pages-artifact@v3
45+
with:
46+
path: website/build
47+
48+
deploy:
49+
name: Deploy to GitHub Pages
50+
needs: build
51+
52+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
53+
permissions:
54+
pages: write # to deploy to Pages
55+
id-token: write # to verify the deployment originates from an appropriate source
56+
57+
# Deploy to the github-pages environment
58+
environment:
59+
name: github-pages
60+
url: ${{ steps.deployment.outputs.page_url }}
61+
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Deploy to GitHub Pages
65+
id: deployment
66+
uses: actions/deploy-pages@v4
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test deployment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
defaults:
9+
run:
10+
working-directory: ./website
11+
12+
jobs:
13+
test-deploy:
14+
name: Test deployment
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 18
23+
cache: yarn
24+
25+
- name: Install prettier-plugin-java dependencies
26+
working-directory: ./packages/prettier-plugin-java
27+
run: yarn install --frozen-lockfile
28+
- name: Build prettier-plugin-java
29+
working-directory: ./packages/prettier-plugin-java
30+
run: yarn build
31+
32+
- name: Install dependencies
33+
run: yarn install --frozen-lockfile
34+
- name: Test build website
35+
run: yarn build

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@monaco-editor/react": "4.6.0",
2222
"lz-string": "1.5.0",
2323
"prettier": "3.2.5",
24-
"prettier-plugin-java": "link:./../packages/prettier-plugin-java",
24+
"prettier-plugin-java": "file:./../packages/prettier-plugin-java/dist",
2525
"prism-react-renderer": "2.3.1",
2626
"react": "18.2.0",
2727
"react-dom": "18.2.0"

website/yarn.lock

Lines changed: 3 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,38 +1186,6 @@
11861186
"@babel/helper-validator-identifier" "^7.22.20"
11871187
to-fast-properties "^2.0.0"
11881188

1189-
"@chevrotain/[email protected]":
1190-
version "11.0.3"
1191-
resolved "https://registry.yarnpkg.com/@chevrotain/cst-dts-gen/-/cst-dts-gen-11.0.3.tgz#5e0863cc57dc45e204ccfee6303225d15d9d4783"
1192-
integrity sha512-BvIKpRLeS/8UbfxXxgC33xOumsacaeCKAjAeLyOn7Pcp95HiRbrpl14S+9vaZLolnbssPIUuiUd8IvgkRyt6NQ==
1193-
dependencies:
1194-
"@chevrotain/gast" "11.0.3"
1195-
"@chevrotain/types" "11.0.3"
1196-
lodash-es "4.17.21"
1197-
1198-
"@chevrotain/[email protected]":
1199-
version "11.0.3"
1200-
resolved "https://registry.yarnpkg.com/@chevrotain/gast/-/gast-11.0.3.tgz#e84d8880323fe8cbe792ef69ce3ffd43a936e818"
1201-
integrity sha512-+qNfcoNk70PyS/uxmj3li5NiECO+2YKZZQMbmjTqRI3Qchu8Hig/Q9vgkHpI3alNjr7M+a2St5pw5w5F6NL5/Q==
1202-
dependencies:
1203-
"@chevrotain/types" "11.0.3"
1204-
lodash-es "4.17.21"
1205-
1206-
"@chevrotain/[email protected]":
1207-
version "11.0.3"
1208-
resolved "https://registry.yarnpkg.com/@chevrotain/regexp-to-ast/-/regexp-to-ast-11.0.3.tgz#11429a81c74a8e6a829271ce02fc66166d56dcdb"
1209-
integrity sha512-1fMHaBZxLFvWI067AVbGJav1eRY7N8DDvYCTwGBiE/ytKBgP8azTdgyrKyWZ9Mfh09eHWb5PgTSO8wi7U824RA==
1210-
1211-
"@chevrotain/[email protected]":
1212-
version "11.0.3"
1213-
resolved "https://registry.yarnpkg.com/@chevrotain/types/-/types-11.0.3.tgz#f8a03914f7b937f594f56eb89312b3b8f1c91848"
1214-
integrity sha512-gsiM3G8b58kZC2HaWR50gu6Y1440cHiJ+i3JUvcp/35JchYejb2+5MVeJK0iKThYpAa/P2PYFV4hoi44HD+aHQ==
1215-
1216-
"@chevrotain/[email protected]":
1217-
version "11.0.3"
1218-
resolved "https://registry.yarnpkg.com/@chevrotain/utils/-/utils-11.0.3.tgz#e39999307b102cff3645ec4f5b3665f5297a2224"
1219-
integrity sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==
1220-
12211189
12221190
version "1.5.0"
12231191
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
@@ -3009,25 +2977,6 @@ cheerio@^1.0.0-rc.12:
30092977
parse5 "^7.0.0"
30102978
parse5-htmlparser2-tree-adapter "^7.0.0"
30112979

3012-
3013-
version "0.3.1"
3014-
resolved "https://registry.yarnpkg.com/chevrotain-allstar/-/chevrotain-allstar-0.3.1.tgz#b7412755f5d83cc139ab65810cdb00d8db40e6ca"
3015-
integrity sha512-b7g+y9A0v4mxCW1qUhf3BSVPg+/NvGErk/dOkrDaHA0nQIQGAtrOjlX//9OQtRlSCy+x9rfB5N8yC71lH1nvMw==
3016-
dependencies:
3017-
lodash-es "^4.17.21"
3018-
3019-
3020-
version "11.0.3"
3021-
resolved "https://registry.yarnpkg.com/chevrotain/-/chevrotain-11.0.3.tgz#88ffc1fb4b5739c715807eaeedbbf200e202fc1b"
3022-
integrity sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==
3023-
dependencies:
3024-
"@chevrotain/cst-dts-gen" "11.0.3"
3025-
"@chevrotain/gast" "11.0.3"
3026-
"@chevrotain/regexp-to-ast" "11.0.3"
3027-
"@chevrotain/types" "11.0.3"
3028-
"@chevrotain/utils" "11.0.3"
3029-
lodash-es "4.17.21"
3030-
30312980
chokidar@^3.4.2, chokidar@^3.5.3:
30322981
version "3.5.3"
30332982
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
@@ -5042,15 +4991,6 @@ isobject@^3.0.1:
50424991
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
50434992
integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==
50444993

5045-
5046-
version "2.3.0"
5047-
resolved "https://registry.yarnpkg.com/java-parser/-/java-parser-2.3.0.tgz#13037364c04bf7386bef841f872cbc5e8b53830f"
5048-
integrity sha512-P6Ma4LU1w/e0Lr4SVM/0PtqCGoL2/i/KP9ZoiyLa824oBqhF0yGTgHDyZkLgp9GTzqR43wm5wabE56FF5X7cqg==
5049-
dependencies:
5050-
chevrotain "11.0.3"
5051-
chevrotain-allstar "0.3.1"
5052-
lodash "4.17.21"
5053-
50544994
jest-util@^29.7.0:
50554995
version "29.7.0"
50564996
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc"
@@ -5250,11 +5190,6 @@ locate-path@^7.1.0:
52505190
dependencies:
52515191
p-locate "^6.0.0"
52525192

5253-
[email protected], lodash-es@^4.17.21:
5254-
version "4.17.21"
5255-
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
5256-
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
5257-
52585193
lodash.debounce@^4.0.8:
52595194
version "4.0.8"
52605195
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
@@ -5270,7 +5205,7 @@ lodash.uniq@^4.5.0:
52705205
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
52715206
integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==
52725207

5273-
lodash@4.17.21, lodash@^4.17.20, lodash@^4.17.21:
5208+
lodash@^4.17.20, lodash@^4.17.21:
52745209
version "4.17.21"
52755210
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
52765211
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
@@ -6782,12 +6717,8 @@ postcss@^8.4.17, postcss@^8.4.21, postcss@^8.4.26:
67826717
picocolors "^1.0.0"
67836718
source-map-js "^1.0.2"
67846719

6785-
"prettier-plugin-java@link:../packages/prettier-plugin-java":
6786-
version "2.6.0"
6787-
dependencies:
6788-
java-parser "2.3.0"
6789-
lodash "4.17.21"
6790-
prettier "3.2.5"
6720+
"prettier-plugin-java@file:../packages/prettier-plugin-java/dist":
6721+
version "0.0.0"
67916722

67926723
67936724
version "3.2.5"

0 commit comments

Comments
 (0)