Skip to content

refactor: Also import TowingBeams as tractor beams #667

refactor: Also import TowingBeams as tractor beams

refactor: Also import TowingBeams as tractor beams #667

Workflow file for this run

name: Docker Build Dev
on:
push:
branches: [ develop ]
jobs:
phpunit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Installing PHP
uses: shivammathur/setup-php@master
with:
php-version: '8.2'
- name: Get Composer Cache Directory 2
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: actions-cache
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Cache PHP dependencies
uses: actions/cache@v3
id: vendor-cache
with:
path: vendor
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
- name: Setup env file
run: cp .env.ci .env
- name: Composer install
if: steps.vendor-cache.outputs.cache-hit != 'true'
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --prefer-dist
- name: Setup keys
run: php artisan key:generate
- name: Fix perms for dirs
run: chmod -R 777 storage bootstrap/cache
- name: Migrate database
env:
DB_CONNECTION: 'sqlite'
DB_DATABASE: 'db.sqlite'
run: touch database/db.sqlite; php artisan migrate
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: 'sqlite'
DB_DATABASE: 'db.sqlite'
run: vendor/phpunit/phpunit/phpunit
main:
runs-on: ubuntu-latest
needs: phpunit
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
tags: scwiki/api:dev
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache