mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
Gitpod setup improvements (#2789)
* install latest pnpm version in docker image * Add astro-build vscode extension in Gitpod setup * automatically open preview when port 3000 is used * run astro build during prebuild * Run starter demo when starting this workspace * and $ASTRO_NEW to run specific example * open index.astro of selected project * Add sleep 1 before running code command * use `gp await-port` instead of sleep
This commit is contained in:
parent
6eb494796e
commit
60fe7bd41e
2 changed files with 15 additions and 5 deletions
4
.gitpod.Dockerfile
vendored
Normal file
4
.gitpod.Dockerfile
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
FROM gitpod/workspace-node
|
||||||
|
|
||||||
|
# Install latest pnpm
|
||||||
|
RUN pnpm i -g pnpm
|
16
.gitpod.yml
16
.gitpod.yml
|
@ -1,15 +1,21 @@
|
||||||
---
|
---
|
||||||
|
image:
|
||||||
|
file: .gitpod.Dockerfile
|
||||||
# Commands to start on workspace startup
|
# Commands to start on workspace startup
|
||||||
tasks:
|
tasks:
|
||||||
- init: pnpm install
|
- init: |
|
||||||
command: pnpm run build
|
pnpm install
|
||||||
|
pnpm run build
|
||||||
|
command: |
|
||||||
|
[[ ! -z "$ASTRO_NEW" ]] && gp await-port 23000 && cd "$GITPOD_REPO_ROOT"/examples/"$ASTRO_NEW" && code src/pages/index.astro && pnpm start
|
||||||
vscode:
|
vscode:
|
||||||
extensions:
|
extensions:
|
||||||
# TODO Once astro is on [vsx](https://open-vsx.org/), we should be able to specify it as an extension as well!
|
- astro-build.astro-vscode
|
||||||
# https://www.gitpod.io/docs/vscode-extensions
|
|
||||||
- https://marketplace.visualstudio.com/_apis/public/gallery/publishers/astro-build/vsextensions/astro-vscode/0.7.13/vspackage
|
|
||||||
- esbenp.prettier-vscode
|
- esbenp.prettier-vscode
|
||||||
- dbaeumer.vscode-eslint
|
- dbaeumer.vscode-eslint
|
||||||
|
ports:
|
||||||
|
- port: 3000
|
||||||
|
onOpen: open-preview
|
||||||
github:
|
github:
|
||||||
prebuilds:
|
prebuilds:
|
||||||
# enable for the master/default branch (defaults to true)
|
# enable for the master/default branch (defaults to true)
|
||||||
|
|
Loading…
Reference in a new issue