-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.55 KB
/
Copy pathdeploy.yml
File metadata and controls
62 lines (54 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: CI and deploy
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
check:
runs-on: [self-hosted, linux, x64]
concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v5
- name: Install dependencies
run: |
set -e
cp .env.example .env
composer install --no-interaction --prefer-dist
php artisan key:generate
npm ci
- name: Typecheck
run: npm run typecheck
- name: Build
run: npm run build
- name: Frontend tests
run: npm test
env:
LARAVEL_BYPASS_ENV_CHECK: 1
- name: Tests
run: php artisan test --compact
deploy:
needs: check
if: github.event_name != 'pull_request'
runs-on: [self-hosted, linux, x64]
concurrency:
group: deploy
cancel-in-progress: false
steps:
- name: Pull and deploy
run: |
set -e
cd /srv/apps/blueva-menu
# Mirror the remote rather than merge into it: a deploy checkout has
# nothing worth keeping, and a rewritten history makes a fast-forward
# impossible. Ignored files (.env, vendor, public/build) are untouched.
git fetch origin main
git reset --hard origin/main
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
npm ci
npm run build
php artisan migrate --force
php artisan optimize:clear
php artisan optimize