diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cad0741..6f8c194 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,7 +4,7 @@ on: push: branches: [master, main] repository_dispatch: - types: [docs-updated] + types: [docs-updated, version-released] workflow_dispatch: permissions: @@ -28,14 +28,7 @@ jobs: node-version: 20 cache: npm - # ── Build website ── - - name: Install website dependencies - run: npm ci - - - name: Build website - run: npm run build - - # ── Build docs (from opencli repo) ── + # ── Checkout opencli repo (needed for version + docs) ── - name: Checkout opencli repo uses: actions/checkout@v4 with: @@ -46,6 +39,22 @@ jobs: package.json package-lock.json + - name: Extract opencli version + id: version + run: | + VERSION=$(node -p "require('./_opencli/package.json').version") + echo "OPENCLI_VERSION=$VERSION" >> "$GITHUB_OUTPUT" + + # ── Build website ── + - name: Install website dependencies + run: npm ci + + - name: Build website + run: npm run build + env: + VITE_OPENCLI_VERSION: ${{ steps.version.outputs.OPENCLI_VERSION }} + + # ── Build docs ── - name: Install docs dependencies working-directory: _opencli run: npm ci @@ -65,6 +74,7 @@ jobs: with: path: ./dist + deploy: environment: name: github-pages diff --git a/src/App.tsx b/src/App.tsx index 9eace77..31008ab 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -109,7 +109,7 @@ function Hero() {
- v1.0 — Now with Desktop App Support + v{import.meta.env.VITE_OPENCLI_VERSION || '1.0'} — Now with Desktop App Support

Make Any Website