[web] reload editor if server changes source, like when converting ur… #93
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "@luzzle/web" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'web/v*' | |
| paths: | |
| - 'apps/web/**' | |
| - 'packages/web/config/**' | |
| - 'packages/web/theme/**' | |
| - 'packages/web/db/**' | |
| - 'packages/web/jobs/**' | |
| - 'packages/web/pieces/**' | |
| - 'apps/core/**' | |
| - '.github/workflows/web.yml' | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: apps/web | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '26' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| working-directory: . | |
| run: pnpm install --frozen-lockfile | |
| - name: Build shared packages | |
| working-directory: . | |
| run: pnpm --filter @luzzle/core --filter @luzzle/web.config --filter @luzzle/web.theme --filter @luzzle/web.db --filter @luzzle/web.jobs --filter @luzzle/web.pieces build | |
| - name: Lint | |
| run: pnpm run lint | |
| - name: mock config | |
| run: touch config.yaml | |
| - name: mock .env | |
| run: touch .env | |
| - name: Check | |
| run: pnpm run check | |
| build-push: | |
| needs: check | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Check Version | |
| if: github.ref_type == 'tag' | |
| run: | | |
| VERSION_FROM_PKG=$(node -p "require('./apps/web/package.json').version") | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| VERSION_FROM_TAG=${TAG_NAME#web/v} | |
| if [ "$VERSION_FROM_TAG" != "$VERSION_FROM_PKG" ]; then | |
| echo "Version mismatch: Tag version $VERSION_FROM_TAG does not match package.json version $VERSION_FROM_PKG" | |
| exit 1 | |
| fi | |
| echo "Version $VERSION_FROM_PKG matches." | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ghcr.io/eleith/luzzle-web | |
| tags: | | |
| type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} | |
| type=match,pattern=web/v(\d+),group=1 | |
| type=match,pattern=web/v(\d+\.\d+),group=1 | |
| type=match,pattern=web/v(\d+\.\d+\.\d+),group=1 | |
| - name: Create dummy npmrc | |
| run: touch .npmrc | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: apps/web/Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| secrets: | | |
| "npmrc=.npmrc" |