-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (72 loc) · 2.38 KB
/
youkok2.yaml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: youkok2
on:
push:
branches: main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
##############################################################
# Workflow setup
##############################################################
- name: Checkout
uses: actions/checkout@v4
- name: Get release version
id: get_version
run: echo "name=RELEASE_VERSION::$(echo $GITHUB_SHA | cut -c1-8)" >> $GITHUB_ENV
##############################################################
# Frontend
##############################################################
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ./frontend/.nvmrc
- name: Build site frontend
run: |
cd frontend
npm i --force
npm run build:production
- name: Build admin frontend
run: |
cd frontend-admin
npm i --force
npm run build:production
##############################################################
# Backend
##############################################################
- name: Setup PHP with specific version of PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.3.11'
tools: composer
- name: Install site backend dependencies
run: |
cd youkok2
composer install
##############################################################
# Build and push docker images
##############################################################
- name: Build and publish nginx to Registry
uses: elgohr/Publish-Docker-Github-Action@master
env:
ENV: prod
COMPOSER_ALLOW_SUPERUSER: 1
with:
name: optimuscrime/youkok2-nginx
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: docker_nginx.Dockerfile
buildargs: ENV
tags: "latest,${{ env.RELEASE_VERSION }}"
- name: Build and publish php to Registry
uses: elgohr/Publish-Docker-Github-Action@master
env:
ENV: prod
with:
name: optimuscrime/youkok2-php
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: docker_php.Dockerfile
buildargs: ENV,COMPOSER_ALLOW_SUPERUSER
tags: "latest,${{ env.RELEASE_VERSION }}"