Files
hereconnect/.gitea/workflows/deploy-app-frontend.yaml
T
ti b6e8ba4eae
Deploy app frontend / app frontend (push) Failing after 1m0s
Deploy service couchdb / service couchdb (push) Successful in 1m8s
Deploy db-migrations / db-migrations (push) Failing after 44s
Deploy service tg-bot / service tg-bot (push) Failing after 3m0s
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Failing after 1m31s
fix ci
2024-12-12 19:19:59 +02:00

72 lines
2.7 KiB
YAML

name: Deploy app frontend
run-name: ${{ github.actor }} deployed to build branch
on:
push:
branches:
- main
paths:
- 'apps/frontend/**'
- '.gitea/workflows/deploy-app-frontend.yaml'
- 'docker-compose.yml'
- 'package.json'
- 'pnpm-lock.yaml'
jobs:
app frontend:
runs-on: ubuntu-latest
container:
volumes:
- /www/hereconnect.condev.ru:/www/hereconnect.condev.ru
env:
VITE_MANIFEST_NAME: НаСвязи
VITE_MANIFEST_SHORT_NAME: НаСвязи
VITE_MANIFEST_ID: https://hereconnect.condev.ru
VITE_READ_BASE_URL: ${{ vars.READ_BASE_URL }}
#VITE_MANIFEST_START_URL: https://hereconnect.condev.ru/
#VITE_MANIFEST_SCOPE: https://hereconnect.condev.ru/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Set up Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 'latest' # или укажите конкретную версию, например, '1.0.0'
- name: install dependencies
run: |
corepack enable pnpm && corepack use pnpm@8.15.9
pnpm deploy --filter frontend --frozen-lockfile build/frontend
- name: build production
run: cd build/frontend && bun vite build --emptyOutDir --outDir /www/hereconnect.condev.ru/build-${{env.GITHUB_SHA}}-prod/
- name: compress production with Brotli
uses: StefH/ghaction-CompressFiles@v2
with:
path: /www/hereconnect.condev.ru/build-${{env.GITHUB_SHA}}-prod/
extensions: '.css,.html,.js,.svg,.eot,.ttf,.woff,.woff2,.ico'
tools: 'brotli'
- name: deploy production
run: mv -v /www/hereconnect.condev.ru/current-prod /www/hereconnect.condev.ru/old-prod && mv -v /www/hereconnect.condev.ru/build-${{env.GITHUB_SHA}}-prod /www/hereconnect.condev.ru/current-prod && rm -rf /www/hereconnect.condev.ru/old-prod
- name: build dev
run: cd build/frontend && bun vite build --emptyOutDir --mode development --outDir /www/hereconnect.condev.ru/build-${{env.GITHUB_SHA}}-dev/
- name: deploy dev
run: mv -v /www/hereconnect.condev.ru/current-dev /www/hereconnect.condev.ru/old-dev && mv -v /www/hereconnect.condev.ru/build-${{env.GITHUB_SHA}}-dev /www/hereconnect.condev.ru/current-dev && rm -rf /www/hereconnect.condev.ru/old-dev
- name: cleanup build directories
if: always()
run: |
echo "Found directories:"
find /www/hereconnect.condev.ru/ -maxdepth 1 -type d -name "build-${{env.GITHUB_SHA}}-*"
echo "Deleting directories:"
find /www/hereconnect.condev.ru/ -maxdepth 1 -type d -name "build-${{env.GITHUB_SHA}}-*" -print -exec rm -rf {} +