1- name : ci
2- on : [push]
1+ name : CI/CD Pipeline
2+ on :
3+ push :
4+ branches : [main, develop]
5+ pull_request :
6+ branches : [main, develop]
7+
38jobs :
4- tests :
5- runs-on : ${{ matrix.operating-system }}
6- strategy :
7- fail-fast : false
8- matrix :
9- operating-system : [ubuntu-20.04]
9+ lint :
10+ runs-on : ubuntu-24.04
11+ timeout-minutes : 60
12+ env :
13+ DOCKER_INTERACTIVE : false
1014 steps :
15+ # === SETUP PHASE ===
1116 - name : Checkout
12- uses : actions/checkout@v3
17+ uses : actions/checkout@v5
1318 with :
1419 submodules : recursive
20+
21+ - name : Setup Docker Compose
22+ uses : docker/setup-compose-action@v1
23+
24+ - name : Setup Task
25+ uses : go-task/setup-task@v1
26+
27+ - name : Setup Node.js
28+ uses : actions/setup-node@v6
29+ with :
30+ node-version-file : ' .nvmrc'
31+ cache : ' npm'
32+ cache-dependency-path : ' package-lock.json'
33+
34+ - name : Setup cache
35+ uses : actions/cache@v4
36+ with :
37+ path : node_modules
38+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
39+ restore-keys : ${{ runner.os }}-node-
40+
41+ - name : Install dependencies
42+ run : |
43+ if [ ! -d node_modules ]; then
44+ npm install
45+ fi
46+
47+ - name : Setup environment files
48+ run : |
49+ cp .env.example .env
50+
51+ - name : lint all
52+ run : task lint:all
53+
54+ launch :
55+ runs-on : ubuntu-24.04
56+ timeout-minutes : 60
57+ env :
58+ DOCKER_INTERACTIVE : false
59+ steps :
60+ # === SETUP PHASE ===
61+ - name : Checkout
62+ uses : actions/checkout@v5
63+ with :
64+ submodules : recursive
65+
66+ - name : Setup Docker Compose
67+ uses : docker/setup-compose-action@v1
68+
69+ - name : Setup Task
70+ uses : go-task/setup-task@v1
71+
72+ - name : Setup Node.js
73+ uses : actions/setup-node@v6
74+ with :
75+ node-version-file : ' .nvmrc'
76+ cache : ' npm'
77+ cache-dependency-path : ' package-lock.json'
78+
1579 - name : Repository lampy
16- uses : actions/checkout@v3
80+ uses : actions/checkout@v5
1781 with :
1882 submodules : recursive
19- ref : ' v2.0'
2083 repository : koromerzhin/lampy
84+ ref : ' 4.3'
2185 path : lampy
22- - name : Install npm dependencies
23- run : npm install
24- - name : ' set .env'
25- run : ' cp .env.example .env'
26- - name : ' SET BDD'
27- run : npm run bdd:mariadb
28- - name : ' Launch Lampy'
29- run : cd lampy && npm run exec
30- - name : ' Image pull'
31- run : npm run docker:getpull-image
32- - name : ' Build containers'
33- run : npm run docker:deploy
34- - name : ' Waiting'
35- run : npm run docker:waiting
36- - name : linter readme.md
37- run : npm run lint:markdown
86+
87+ - name : Setup cache
88+ uses : actions/cache@v4
89+ with :
90+ path : node_modules
91+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
92+ restore-keys : ${{ runner.os }}-node-
93+
94+ - name : Install dependencies
95+ run : |
96+ if [ ! -d node_modules ]; then
97+ npm install
98+ fi
99+
100+ - name : Setup environment files
101+ run : |
102+ cp .env.example .env
103+
104+ - name : Setup database and infrastructure
105+ run : |
106+ task symfony:copysql
107+ cd lampy && task lampy:exec
108+
109+ - name : Deploy containers
110+ run : |
111+ task create:apps
112+ task symfony:set-env-ids
113+ task symfony:getpull-image
114+ task symfony:getapacheconf
115+ task symfony:install-first
116+ task symfony:deploy
117+ task symfony:waiting
118+ # === LINTING PHASE ===
119+ - name : Frontend linting
120+ run : |
121+ npm run lint:markdown
122+
123+ - name : Run Cypress tests
124+ uses : cypress-io/github-action@v6
125+ continue-on-error : true
126+ with :
127+ wait-on-timeout : 120
128+ browser : chrome
129+ record : false
130+ parallel : false
131+ config : screenshotOnRunFailure=true,video=true,videoCompression=32,defaultCommandTimeout=10000,requestTimeout=10000,responseTimeout=10000,retries={"runMode":2,"openMode":0}
132+ env :
133+ CYPRESS_CACHE_FOLDER : ~/.cache/Cypress
134+ CYPRESS_RECORD_KEY : ${{ secrets.CYPRESS_RECORD_KEY }}
135+
136+ - name : Docker stack stop
137+ if : always()
138+ run : |
139+ docker stack rm symfony
140+ docker stack rm lampy
141+
142+ # === ARTIFACTS PHASE ===
143+ - name : Archive test results
144+ uses : actions/upload-artifact@v4
145+ if : always()
146+ with :
147+ name : " test-results-${{ github.run_number }}-${{ github.sha }}"
148+ path : |
149+ cypress/screenshots
150+ cypress/videos
151+ cypress/reports
152+ retention-days : 7
153+ if-no-files-found : ignore
154+ compression-level : 6
0 commit comments