Skip to content

Commit 06ffcf0

Browse files
authored
playground: setup autodeploy in ci (#456)
1 parent 66c7075 commit 06ffcf0

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

.github/workflows/rust.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,50 @@ jobs:
254254
cache-from: type=gha
255255
cache-to: type=gha,mode=max
256256

257+
deploy-playground:
258+
if: startsWith(github.ref, 'refs/tags/')
259+
runs-on: ubuntu-22.04
260+
steps:
261+
- name: Checkout
262+
uses: actions/checkout@v4
263+
264+
- name: Cache
265+
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # pin@v2
266+
267+
- name: Install wasm-pack
268+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
269+
270+
- uses: pnpm/action-setup@v2
271+
with:
272+
version: 8
273+
- uses: actions/setup-node@v3
274+
with:
275+
node-version-file: "playground/package.json"
276+
cache-dependency-path: "playground/pnpm-lock.yaml"
277+
cache: "pnpm"
278+
279+
- name: Install JS dependencies
280+
working-directory: "playground"
281+
run: pnpm install
282+
283+
- name: Build
284+
working-directory: "playground"
285+
run: pnpm build
286+
287+
- name: Deploy to Netlify
288+
uses: nwtgck/actions-netlify@v2
289+
with:
290+
publish-dir: "playground/dist"
291+
production-branch: main
292+
github-token: ${{ secrets.GITHUB_TOKEN }}
293+
deploy-message: "Deploy from GitHub Actions"
294+
fails-without-credentials: true
295+
enable-pull-request-comment: false
296+
enable-commit-comment: false
297+
env:
298+
NETLIFY_AUTH_TOKEN: ${{ secrets.PLAYGROUND_NETLIFY_AUTH_TOKEN }}
299+
NETLIFY_SITE_ID: ${{ secrets.PLAYGROUND_NETLIFY_SITE_ID }}
300+
257301
lint:
258302
needs: pre_job
259303
if: needs.pre_job.outputs.should_skip != 'true'

playground/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,9 @@
3434
"typescript": "~5.7.2",
3535
"typescript-eslint": "^8.22.0",
3636
"vite": "^6.1.0"
37+
},
38+
"volta": {
39+
"node": "18.7.0",
40+
"pnpm": "8.15.8"
3741
}
3842
}

playground/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ select * from users;
2929

3030
const SETTINGS = {
3131
value: DEFAULT_CONTENT,
32-
language: "sql",
32+
language: "pgsql",
3333
tabSize: 2,
3434
theme: "vs-dark",
3535
minimap: { enabled: false },

0 commit comments

Comments
 (0)