Skip to content

chore(deps-dev): bump vite from 5.4.11 to 5.4.12 #449

chore(deps-dev): bump vite from 5.4.11 to 5.4.12

chore(deps-dev): bump vite from 5.4.11 to 5.4.12 #449

Workflow file for this run

name: PR Preview
env:
HUSKY: 0
on:
pull_request:
types: [opened, synchronize, reopened, closed]
jobs:
prepare:
runs-on: ubuntu-24.04
env:
PREVIEW_API_DOMAIN: 'test-apps-ninja02.konturlabs.com'
KEYCLOAK_URL: 'https://dev-keycloak.k8s-01.konturlabs.com'
KEYCLOAK_REALM: 'dev'
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: |
~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm i --prod=false
- name: Apply domain changes
if: github.event.action != 'closed'
run: |
sed -i "s|https://disaster.ninja|https://${PREVIEW_API_DOMAIN}|" configs/config.default.json
sed -i "s|\"KEYCLOAK_URL\": \"https://keycloak01.kontur.io\"|\"KEYCLOAK_URL\": \"${KEYCLOAK_URL}\"|" configs/config.default.json
sed -i "s|\"KEYCLOAK_REALM\": \"kontur\"|\"KEYCLOAK_REALM\": \"${KEYCLOAK_REALM}\"|" configs/config.default.json
sed -i "s|VITE_BASE_PATH=/active/|VITE_BASE_PATH=/|" .env.production
sed -i "s|VITE_STATIC_PATH=static/|VITE_STATIC_PATH=|" .env.production
- name: Build main app and Cosmos
if: github.event.action != 'closed'
run: |
pnpm build
pnpm cosmos:build
- name: Enable surge.sh redirects
run: cp dist/index.html dist/200.html
- uses: actions/upload-artifact@v3
if: github.event.action != 'closed'
with:
name: main-app
path: ${{ github.workspace }}/dist
- uses: actions/upload-artifact@v3
if: github.event.action != 'closed'
with:
name: cosmos
path: ${{ github.workspace }}/cosmos-export
deploy:
needs: prepare
runs-on: ubuntu-24.04
env:
MAIN_URL: https://${{ github.repository_owner }}-${{ github.event.repository.name }}-pr-${{ github.event.number }}-main.surge.sh
COSMOS_URL: https://${{ github.repository_owner }}-${{ github.event.repository.name }}-pr-${{ github.event.number }}-cosmos.surge.sh
outputs:
main_url: ${{ env.MAIN_URL }}
cosmos_url: ${{ env.COSMOS_URL }}
steps:
- uses: actions/checkout@v4
- name: Install Surge
run: npm install -g surge
- uses: actions/download-artifact@v3
with:
name: main-app
path: dist
- uses: actions/download-artifact@v3
with:
name: cosmos
path: cosmos-export
- name: Deploy main app to Surge
if: github.event.action != 'closed'
run: surge --project ./dist --domain ${{ env.MAIN_URL }} --token ${{ secrets.SURGE_TOKEN }}
- name: Deploy Cosmos to Surge
if: github.event.action != 'closed'
run: surge --project ./cosmos-export --domain ${{ env.COSMOS_URL }} --token ${{ secrets.SURGE_TOKEN }}
- name: Teardown main app preview
if: github.event.action == 'closed'
run: surge teardown ${{ env.MAIN_URL }} --token ${{ secrets.SURGE_TOKEN }}
- name: Teardown Cosmos preview
if: github.event.action == 'closed'
run: surge teardown ${{ env.COSMOS_URL }} --token ${{ secrets.SURGE_TOKEN }}
comment:
needs: deploy
runs-on: ubuntu-24.04
steps:
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Preview environments
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
Preview environments for this PR:
- Main App: ${{ needs.deploy.outputs.main_url }}
- Cosmos: ${{ needs.deploy.outputs.cosmos_url }}
These previews are automatically updated with each commit.
**Note:** After a new deployment, it may take a few minutes for the changes to propagate and for caches to update. During this time, you might experience temporary loading issues or see an older version of the app. If the app fails to load, please wait a few minutes and try again.
edit-mode: replace