Skip to content

Fix CI: add missing env vars for GitHub and Discord #160

Fix CI: add missing env vars for GitHub and Discord

Fix CI: add missing env vars for GitHub and Discord #160

Workflow file for this run

name: Deploy Codante
on:
push:
branches: [main]
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: codante_test
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: secretroot
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: mbstring, bcmath, zip
tools: composer:v2
coverage: none
- name: Composer install
run: composer install --prefer-dist --no-interaction
- name: Boot Laravel application
run: |
cp .env.github .env
php artisan key:generate
php artisan --version
- name: Run migrations
run: php artisan migrate --force
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
- name: Execute tests (Unit and Feature tests) via PHPUnit
run: vendor/bin/phpunit
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: tests
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer:v2
coverage: none
- name: Composer install
run: composer install --prefer-dist --no-interaction
- name: Setup Deployer
uses: deployphp/action@master
with:
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
dep: deploy -v