Skip to content

Commit

Permalink
ci: automate GitHub Pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jtkiesel committed Jun 18, 2024
1 parent 421fb1f commit b374b5a
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 73 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/github-pages-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Deploy to GitHub Pages

on:
pull_request:
branches:
- main
# push:
# branches:
# - main

defaults:
run:
working-directory: ./website

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install prettier-plugin-java dependencies
working-directory: ./packages/prettier-plugin-java
run: yarn install --frozen-lockfile
- name: Build prettier-plugin-java
working-directory: ./packages/prettier-plugin-java
run: yarn build

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
run: yarn build

- name: Check files
run: ls -al

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
35 changes: 35 additions & 0 deletions .github/workflows/github-pages-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test deployment

on:
pull_request:
branches:
- main

defaults:
run:
working-directory: ./website

jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install prettier-plugin-java dependencies
working-directory: ./packages/prettier-plugin-java
run: yarn install --frozen-lockfile
- name: Build prettier-plugin-java
working-directory: ./packages/prettier-plugin-java
run: yarn build

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test build website
run: yarn build
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@monaco-editor/react": "4.6.0",
"lz-string": "1.5.0",
"prettier": "3.2.5",
"prettier-plugin-java": "link:./../packages/prettier-plugin-java",
"prettier-plugin-java": "file:./../packages/prettier-plugin-java/dist",
"prism-react-renderer": "2.3.1",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
75 changes: 3 additions & 72 deletions website/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1186,38 +1186,6 @@
"@babel/helper-validator-identifier" "^7.22.20"
to-fast-properties "^2.0.0"

"@chevrotain/[email protected]":
version "11.0.3"
resolved "https://registry.yarnpkg.com/@chevrotain/cst-dts-gen/-/cst-dts-gen-11.0.3.tgz#5e0863cc57dc45e204ccfee6303225d15d9d4783"
integrity sha512-BvIKpRLeS/8UbfxXxgC33xOumsacaeCKAjAeLyOn7Pcp95HiRbrpl14S+9vaZLolnbssPIUuiUd8IvgkRyt6NQ==
dependencies:
"@chevrotain/gast" "11.0.3"
"@chevrotain/types" "11.0.3"
lodash-es "4.17.21"

"@chevrotain/[email protected]":
version "11.0.3"
resolved "https://registry.yarnpkg.com/@chevrotain/gast/-/gast-11.0.3.tgz#e84d8880323fe8cbe792ef69ce3ffd43a936e818"
integrity sha512-+qNfcoNk70PyS/uxmj3li5NiECO+2YKZZQMbmjTqRI3Qchu8Hig/Q9vgkHpI3alNjr7M+a2St5pw5w5F6NL5/Q==
dependencies:
"@chevrotain/types" "11.0.3"
lodash-es "4.17.21"

"@chevrotain/[email protected]":
version "11.0.3"
resolved "https://registry.yarnpkg.com/@chevrotain/regexp-to-ast/-/regexp-to-ast-11.0.3.tgz#11429a81c74a8e6a829271ce02fc66166d56dcdb"
integrity sha512-1fMHaBZxLFvWI067AVbGJav1eRY7N8DDvYCTwGBiE/ytKBgP8azTdgyrKyWZ9Mfh09eHWb5PgTSO8wi7U824RA==

"@chevrotain/[email protected]":
version "11.0.3"
resolved "https://registry.yarnpkg.com/@chevrotain/types/-/types-11.0.3.tgz#f8a03914f7b937f594f56eb89312b3b8f1c91848"
integrity sha512-gsiM3G8b58kZC2HaWR50gu6Y1440cHiJ+i3JUvcp/35JchYejb2+5MVeJK0iKThYpAa/P2PYFV4hoi44HD+aHQ==

"@chevrotain/[email protected]":
version "11.0.3"
resolved "https://registry.yarnpkg.com/@chevrotain/utils/-/utils-11.0.3.tgz#e39999307b102cff3645ec4f5b3665f5297a2224"
integrity sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==

"@colors/[email protected]":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
Expand Down Expand Up @@ -3009,25 +2977,6 @@ cheerio@^1.0.0-rc.12:
parse5 "^7.0.0"
parse5-htmlparser2-tree-adapter "^7.0.0"

[email protected]:
version "0.3.1"
resolved "https://registry.yarnpkg.com/chevrotain-allstar/-/chevrotain-allstar-0.3.1.tgz#b7412755f5d83cc139ab65810cdb00d8db40e6ca"
integrity sha512-b7g+y9A0v4mxCW1qUhf3BSVPg+/NvGErk/dOkrDaHA0nQIQGAtrOjlX//9OQtRlSCy+x9rfB5N8yC71lH1nvMw==
dependencies:
lodash-es "^4.17.21"

[email protected]:
version "11.0.3"
resolved "https://registry.yarnpkg.com/chevrotain/-/chevrotain-11.0.3.tgz#88ffc1fb4b5739c715807eaeedbbf200e202fc1b"
integrity sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==
dependencies:
"@chevrotain/cst-dts-gen" "11.0.3"
"@chevrotain/gast" "11.0.3"
"@chevrotain/regexp-to-ast" "11.0.3"
"@chevrotain/types" "11.0.3"
"@chevrotain/utils" "11.0.3"
lodash-es "4.17.21"

chokidar@^3.4.2, chokidar@^3.5.3:
version "3.5.3"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
Expand Down Expand Up @@ -5042,15 +4991,6 @@ isobject@^3.0.1:
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==

[email protected]:
version "2.3.0"
resolved "https://registry.yarnpkg.com/java-parser/-/java-parser-2.3.0.tgz#13037364c04bf7386bef841f872cbc5e8b53830f"
integrity sha512-P6Ma4LU1w/e0Lr4SVM/0PtqCGoL2/i/KP9ZoiyLa824oBqhF0yGTgHDyZkLgp9GTzqR43wm5wabE56FF5X7cqg==
dependencies:
chevrotain "11.0.3"
chevrotain-allstar "0.3.1"
lodash "4.17.21"

jest-util@^29.7.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc"
Expand Down Expand Up @@ -5250,11 +5190,6 @@ locate-path@^7.1.0:
dependencies:
p-locate "^6.0.0"

[email protected], lodash-es@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==

lodash.debounce@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
Expand All @@ -5270,7 +5205,7 @@ lodash.uniq@^4.5.0:
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==

lodash@4.17.21, lodash@^4.17.20, lodash@^4.17.21:
lodash@^4.17.20, lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
Expand Down Expand Up @@ -6782,12 +6717,8 @@ postcss@^8.4.17, postcss@^8.4.21, postcss@^8.4.26:
picocolors "^1.0.0"
source-map-js "^1.0.2"

"prettier-plugin-java@link:../packages/prettier-plugin-java":
version "2.6.0"
dependencies:
java-parser "2.3.0"
lodash "4.17.21"
prettier "3.2.5"
"prettier-plugin-java@file:../packages/prettier-plugin-java/dist":
version "0.0.0"

[email protected]:
version "3.2.5"
Expand Down

0 comments on commit b374b5a

Please sign in to comment.