-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.41 KB
/
deploy.yml
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
name: Deploy
on:
push:
branches:
- NDybnov/hw21
env:
COMMENT: 'my-comment-env'
APP_VERSION: 'v01100600'
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Copy .env
run: cd app && cp .env.example .env
- name: UpdateCopy env.APP_VERSION
run: echo 'APP_VERSION=${{ env.APP_VERSION }}' >> app/.env
- name: UpdateCopy env.COMMENT
run: echo 'COMMENT='$(git log -1 --format='%s') >> app/.env
- name: Has dotenv file
run: cd app && ls -a
- name: Build the Docker image
run: cd app && docker compose build
- name: Docker run and detach
run: cd app && docker compose up --detach
- name: Install Dependencies
run: cd app && docker compose exec deploy-php-cli composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Execute tests (Unit and Feature tests) via PHPUnit
run: cd app && docker compose exec deploy-php-cli vendor/phpunit/phpunit/phpunit tests
- name: Test run vie Curl
run: cd app && docker compose exec deploy-php-cli curl 0.0.0.0:8000
deployment:
needs: tests
runs-on: ubuntu-latest
environment:
name: production
url: http://5.35.98.239
steps:
- name: deploy
run: |
echo '..deploy...'
echo ${{ env.APP_VERSION }}
echo ${{ env.COMMENT }}