Skip to content

Commit

Permalink
chore: add gh-actions and supervisor config
Browse files Browse the repository at this point in the history
Signed-off-by: Fery Wardiyanto <[email protected]>
  • Loading branch information
feryardiant committed Nov 30, 2022
1 parent f0bd797 commit 03aac40
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 15 deletions.
39 changes: 28 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
# AWS_ENDPOINT: 'https://is3.cloudhost.id'
# AWS_DEFAULT_REGION: 'ap-southeast-3'
# AWS_BUCKET: creasi-staging
MAIL_FROM_ADDRESS: devtest@creasi.co
MAIL_FROM_ADDRESS: devtest@creasi.dev
SENTRY_LARAVEL_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_TRACE_QUEUE_ENABLED: true
SENTRY_TRACES_SAMPLE_RATE: 1.0
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
extensions: curl, dom, gd, igbinary, imagick, intl, libxml, mbstring, pcntl, pdo, pdo_pgsql, redis, zip
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: xdebug
coverage: none
env:
REDIS_CONFIGURE_OPTS: --enable-redis --enable-redis-igbinary

Expand Down Expand Up @@ -132,7 +132,9 @@ jobs:
with:
timeout_minutes: 5
max_attempts: 3
command: composer update --prefer-dist --no-interaction --no-progress
command: |
composer config -g github-oauth.github.com ${{ secrets.PAT }}
composer update --prefer-dist --no-interaction --no-progress
- name: Run unit tests
run: php artisan test
Expand Down Expand Up @@ -210,7 +212,9 @@ jobs:
with:
timeout_minutes: 5
max_attempts: 3
command: composer update --prefer-dist --no-interaction --no-progress
command: |
composer config -g github-oauth.github.com ${{ secrets.PAT }}
composer update --prefer-dist --no-interaction --no-progress
- name: Setup BrowserStack env # Invokes the setup-env action
uses: browserstack/github-actions/setup-env@master
Expand Down Expand Up @@ -261,6 +265,15 @@ jobs:
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: curl, intl, libxml, mbstring, pcntl, ssh2, zip
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none

- name: Prepare
run: |
[[ ! -d $HOME/.ssh ]] && mkdir $HOME/.ssh
Expand All @@ -270,17 +283,21 @@ jobs:
chmod 600 $HOME/.ssh/* && ls -al $HOME/.ssh/
git config user.name "Creasi.HQ" && git config user.email "[email protected]"
- name: Install dependencies
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 3
command: |
composer config -g github-oauth.github.com ${{ secrets.PAT }}
composer update --prefer-dist --no-interaction --no-progress
- name: Download assets
id: download
uses: actions/download-artifact@v3
with:
name: public
path: public/build

# - name: Deploy repo
# run: |
# git fetch [email protected]:~/git/wanho.git
# git push -fu [email protected]:~/git/wanho.git HEAD:master

- name: Deploy assets
run: rsync -zrtv public/build creasi.co:skeleton.creasi.dev/public/
- name: Deploy repo
run: ./vendor/bin/dep deploy
20 changes: 20 additions & 0 deletions resources/deploy/supervisor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[group:creasi-skeleton]
programs=skeleton-queue,skeleton-schedule

[program:skeleton-queue]
command=php /var/www/skeleton/current/artisan queue:work --timeout=360 --max-time=1200 --tries=3
autostart=true
autorestart=true
startretries=3
startsecs=5
# stdout_logfile=/var/log/creasi/%(program_name)s.log
stderr_logfile=/var/log/creasi/%(program_name)s.err.log

[program:skeleton-schedule]
command=php /var/www/skeleton/current/artisan schedule:work
autostart=true
autorestart=true
startretries=3
startsecs=1
# stdout_logfile=/var/log/creasi/%(program_name)s.log
stderr_logfile=/var/log/creasi/%(program_name)s.err.log
9 changes: 5 additions & 4 deletions resources/views/layouts/navigation.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<nav x-data="{ open: false }" class="bg-white border-b border-gray-100">
<nav x-data="{ open: false }" class="relative bg-white border-b border-gray-100">
<!-- Primary Navigation Menu -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
Expand Down Expand Up @@ -50,16 +50,17 @@
<div class="-mr-2 flex items-center sm:hidden">
<button @click="open = ! open" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out">
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
<path :class="{'hidden': open, 'inline-flex': ! open }" class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
<path :class="{'hidden': ! open, 'inline-flex': open }" class="hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
<path class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
{{-- <path :class="{ hidden: open, 'inline-flex': ! open }" class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
<path :class="{ hidden: ! open, 'inline-flex': open }" class="hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /> --}}
</svg>
</button>
</div>
</div>
</div>

<!-- Responsive Navigation Menu -->
<div :class="{'block': open, 'hidden': ! open}" class="hidden sm:hidden">
<div x-bind:class="{ 'block': open, 'hidden': ! open}" class="hidden sm:hidden">
<div class="pt-2 pb-3 space-y-1">
<x-responsive-nav-link :href="route('home')" :active="request()->routeIs('home')">
{{ __('dashboard.routes.index') }}
Expand Down

0 comments on commit 03aac40

Please sign in to comment.