Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
curtisdelicata authored Jun 8, 2024
1 parent 51b1832 commit a7fc662
Showing 1 changed file with 1 addition and 102 deletions.
103 changes: 1 addition & 102 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Run tests and push Docker image

on:
push:
Expand All @@ -14,42 +14,6 @@ env:
DB_PASSWORD: secret

jobs:
yarn:
runs-on: ubuntu-22.04
env:
NODE_OPTIONS: --max_old_space_size=3072
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_URL: ${{ secrets.SENTRY_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '14'
- uses: borales/actions-yarn@v5
with:
cmd: install
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: 'test node'
run: node -v
- name: 'install & build'
run: |
sudo composer install
sed -i 's/GOOGLE_ANALITICS_TOKEN/${{ secrets.GOOGLE_ANALITICS_TOKEN }}/g' resources/views/stubs/production-index.blade.stub
sudo cp -f resources/views/stubs/production-index.blade.stub vendor/laravel-liberu/core/stubs
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: resources
path: |
public/css/
public/js/
public/images/
resources/views
phpunit:
runs-on: ubuntu-22.04
steps:
Expand All @@ -61,71 +25,6 @@ jobs:
run: |
sudo composer install
sudo php artisan test
phpcpd:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: 'Run Phpcpd'
run: |
sudo composer install
sudo test -f phpcpd.phar || curl -L https://phar.phpunit.de/phpcpd.phar -o phpcpd.phar
sudo php phpcpd.phar app/
php-insights:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: 'Run php-insight'
run: |
sudo composer install
sudo php artisan insights --min-quality=90 --min-complexity=90 --min-architecture=80 --min-style=90 --no-interaction
security:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: 'Run php-insight'
run: |
PHP_SC_VERSION=$(curl -s "https://api.github.com/repos/fabpot/local-php-security-checker/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/;s/^v//')
curl -LSs https://github.com/fabpot/local-php-security-checker/releases/download/v${PHP_SC_VERSION}/local-php-security-checker_${PHP_SC_VERSION}_linux_amd64 > ./php-security-checker
chmod +x ./php-security-checker
unset PHP_SC_VERSION
./php-security-checker
migration:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: mirromutth/[email protected]
with:
mysql database: ${{env.DB_DATABASE}}
mysql user: ${{env.DB_USERNAME}}
mysql password: ${{env.DB_PASSWORD}}
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: 'Run migration'
run: |
sudo composer install
php artisan migrate --force
deploy:
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'deployment' || github.event_name == 'push' }}
needs: [phpunit, phpcpd, migration, yarn, security, php-insights]
steps:
- uses: actions/checkout@v4
- name: 'Trig envoyer'
run: |
curl ${{ secrets.DEPLOY_WEBHOOK }}
docker:
if: github.event_name == 'push'
runs-on: ubuntu-latest
Expand Down

0 comments on commit a7fc662

Please sign in to comment.