forked from badgeteam/Hatchery
-
Notifications
You must be signed in to change notification settings - Fork 1
96 lines (92 loc) · 2.82 KB
/
Copy pathdeploy.yml
File metadata and controls
96 lines (92 loc) · 2.82 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Build and Deploy
on:
push:
branches:
- master
jobs:
laravel-tests:
runs-on: ubuntu-latest
strategy:
max-parallel: 3
matrix:
php-versions: ['8.0']
services:
mysql:
image: mariadb:latest
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: badge
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v1
- name: Install Linux packages
run: sudo apt update && sudo apt install -y --no-install-recommends pyflakes git iverilog arachne-pnr arachne-pnr-chipdb fpga-icestorm fpga-icestorm-chipdb
- name: Install PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
extensions: xdebug, imagick
ini-values: "post_max_size=256M"
- name: Check PHP Version
run: php -v
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist && yarn install && node_modules/.bin/mix --production
- name: Generate key
run: php artisan key:generate
- name: LaraStan
run: vendor/bin/phpstan analyse
- name: Swagger generate
run: php artisan l5-swagger:generate
- name: Populate DB
env:
DB_CONNECTION: mysql
DB_HOST: 127.0.0.1
DB_PORT: 33306
DB_DATABASE: badge
DB_USERNAME: root
DB_PASSWORD: root
run: php artisan migrate --force
- name: Generate sitemap
env:
DB_CONNECTION: mysql
DB_HOST: 127.0.0.1
DB_PORT: 33306
DB_DATABASE: badge
DB_USERNAME: root
DB_PASSWORD: root
run: php artisan sitemap:generate
- name: Config clear
run: php artisan config:clear
- name: Route clear
run: php artisan route:clear
- name: Execute (Unit and Feature) tests via Pest
env:
DB_CONNECTION: mysql
DB_HOST: 127.0.0.1
DB_PORT: 33306
DB_DATABASE: badge
DB_USERNAME: root
DB_PASSWORD: root
DB_TEST_DATABASE: badge
DB_TEST_USERNAME: root
DB_TEST_PASSWORD: root
run: vendor/bin/pest
build:
runs-on: ubuntu-latest
needs: laravel-tests
steps:
- uses: actions/checkout@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: docker build -t ghcr.io/emfcamp/tidal-hatchery:latest .
- name: Publish
run: docker push ghcr.io/emfcamp/tidal-hatchery:latest