fix: correctly save comments for timer #206
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
- production | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
name: 🚀 Deploy website on push | |
jobs: | |
web-deploy: | |
name: 🎉 Deploy | |
runs-on: ubuntu-latest | |
environment: | |
name: |- | |
${{github.ref_name == 'production' && 'production' | |
|| github.ref_name == 'main' && 'staging' | |
|| 'testing' | |
}} | |
url: https://${{vars.SERVER}}/ | |
steps: | |
- name: 🚚 Get latest code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
tools: php-cs-fixer, phpunit | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: vendor | |
key: composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
composer- | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Setup environment variables | |
uses: franzbischoff/replace_envs@v2 | |
env: | |
APP_NAME: ${{ vars.APP_NAME }} | |
APP_ENV: |- | |
${{github.ref_name == 'production' && 'production' | |
|| github.ref_name == 'main' && 'production' | |
|| 'development' | |
}} | |
APP_KEY: ${{ secrets.APP_KEY }} | |
APP_DEBUG: ${{ vars.APP_DEBUG }} | |
APP_URL: ${{ vars.SERVER }} | |
API_KEY: ${{ secrets.API_KEY }} | |
DB_USERNAME: ${{ secrets.DB_USERNAME }} | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
MAIL_MAILER: ${{ secrets.MAIL_MAILER }} | |
MAIL_HOST: ${{ secrets.MAIL_HOST }} | |
MAIL_PORT: ${{ secrets.MAIL_PORT }} | |
MAIL_USERNAME: ${{ secrets.MAIL_USERNAME }} | |
MAIL_PASSWORD: ${{ secrets.MAIL_PASSWORD }} | |
MAIL_ENCRYPTION: ${{ secrets.MAIL_ENCRYPTION }} | |
with: | |
from_file: '.env.template' | |
to_file: '.env' | |
commit: 'false' | |
- name: Install dependencies | |
run: | | |
composer install | |
npm install | |
- name: Run tests | |
run: composer test | |
- name: 🔨 Build Project | |
run: npm run build | |
- name: 📂 Sync files | |
uses: SamKirkland/[email protected] | |
with: | |
server: ${{ vars.SERVER }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
server-dir: ./app/ | |
exclude: | | |
**/.git* | |
**/.git*/** | |
**/node_modules/** | |
**/vendor/** | |
!resources/views/vendor/**/*.blade.php | |
.hybridly/** | |
.vscode/** | |
public/** | |
!public/build/manifest.json | |
tests/** | |
.editorconfig | |
.env.* | |
.php-cs-fixer* | |
.prettier* | |
eslint* | |
package* | |
phpunit.xml | |
*.md | |
tsconfig.json | |
vite.config.ts | |
- name: 📂 Sync public folder | |
uses: SamKirkland/[email protected] | |
with: | |
server: ${{ vars.SERVER }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
local-dir: ./public/ | |
server-dir: ./public_html/ | |
state-name: .ftp-deploy-public-sync-state.json | |
exclude: | | |
index.php | |
build/manifest.json | |
- name: Optimize app | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ vars.SERVER }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
script: | | |
cd app | |
composer install --prefer-dist -o | |
php artisan optimize:clear | |
php artisan optimize | |
php artisan filament:optimize-clear | |
php artisan filament:optimize | |
php artisan migrate --force | |
cleanup: | |
if: github.ref_name != 'production' | |
name: Cleanup deployment | |
needs: web-deploy | |
runs-on: ubuntu-latest | |
environment: | |
name: |- | |
${{github.ref_name == 'production' && 'production' | |
|| github.ref_name == 'main' && 'staging' | |
|| 'testing' | |
}} | |
steps: | |
- name: Refresh database | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ vars.SERVER }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
script: | | |
cd app | |
php artisan migrate:fresh --force | |
php artisan db:seed --force |