Skip to content

echo '' > .env

echo '' > .env #7

Workflow file for this run

name: Backend CI
on:
push:
branches: [ main ]
pull_request:
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring, pdo_mysql
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-interaction
- name: Generate application key
run: echo '' > .env && php artisan key:generate
- name: Optimize Laravel
run: php artisan optimize
- name: Run tests
run: php artisan test --without-tty
- name: Build Docker image
run: docker build -t ghcr.io/${{ github.repository }}:latest .
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image
run: docker push ghcr.io/${{ github.repository }}:latest