-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 1.96 KB
/
deploy.yml
File metadata and controls
64 lines (54 loc) · 1.96 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
63
64
name: Build and Package Osse with FrankenPHP
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Backend Repository
uses: actions/checkout@v4
- name: Checkout Frontend Repository
uses: actions/checkout@v4
with:
repository: amytho/osse-web
path: frontend
- name: Install Node.js and Dependencies
working-directory: frontend
run: |
corepack enable
npm install
npm run build
- name: Move Frontend to Laravel Public Directory
run: mv frontend/dist/* public/dist
# Run osse in production with default config options.
- name: Generate Environment Configurations
run: |
cp .env.example .env
sed -i'' -e 's/^APP_ENV=.*/APP_ENV=production/' -e 's/^APP_DEBUG=.*/APP_DEBUG=false/' .env
# Destroy files that are not needed in production to save space.
- name: Destroy Development Files
run: |
rm -Rf tests/
rm -Rf .git
rm -Rf .github
rm -Rf .vscode
rm -Rf .node_modules
# Build the static executable using the frankenphp dockerfile.
- name: Build Dockerfile
run: |
docker build -t static-laravel-app -f static-build.Dockerfile .
docker cp $(docker create --name static-laravel-app-tmp static-laravel-app):/go/src/app/dist/frankenphp-linux-x86_64 frankenphp ; docker rm static-laravel-app-tmp
# Rename files to be more clear about their usage
- name: Rename Files
run: |
mv frakenphp osse
mv production-setup.sh osse.sh
# Upload the files to the action so I can add them to a release.
- name: Upload FrankenPHP Executable
uses: actions/upload-artifact@v4
with:
name: osse
compression-level: 0 # The server executable is already compressed.
path: |
osse
osse.sh