Skip to content

Commit

Permalink
Merge pull request #63 from garasijogi/staging
Browse files Browse the repository at this point in the history
To the first Realease
  • Loading branch information
ryumada authored Oct 24, 2021
2 parents 9e8e16d + 19a6248 commit c2642d0
Show file tree
Hide file tree
Showing 107 changed files with 4,002 additions and 1,051 deletions.
21 changes: 14 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
APP_NAME="Mamoto Website"
APP_ENV=local
# NEEDED
APP_KEY=
APP_LOCALE='id'
TINIFY_API_KEY=

# consider changing on the production server
APP_ENV=local
APP_DEBUG=true
APP_URL=http://localhost

APP_NAME="Mamoto Website"
APP_LOCALE='id'

LOG_CHANNEL=stack

# using mysql
Expand All @@ -30,10 +35,12 @@ QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
# using redis
# REDIS_HOST=127.0.0.1
# REDIS_PASSWORD=null
# REDIS_PORT=6379

# mail settings
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
Expand All @@ -57,4 +64,4 @@ MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

# add local storage to public
FILESYSTEM_DRIVER=public
FILESYSTEM_DRIVER=public
90 changes: 90 additions & 0 deletions .github/workflows/mergeDeploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Merge and Deploy
on:
push:
branches:
- main
jobs:
merge-and-deploy:
runs-on: ubuntu-latest
steps:
# merge this branch to deploy/ztemplate
- uses: actions/checkout@master
- name: Merge ${{ github.ref }} > deploy/ztemplate
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: ${{ github.ref }}
target_branch: deploy/ztemplate
github_token: ${{ github.token }}

# remove local workspaces; remove all files in the environment
- uses: AutoModality/action-clean@v1

# checkout deploy/ztemplate
- uses: actions/checkout@v2
with:
ref: deploy/ztemplate
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

# merge deploy/ztemplate to deploy/run
- uses: actions/checkout@master
- name: Merge deploy/ztemplate > deploy/run
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: ${{ github.ref }}
target_branch: deploy/run
github_token: ${{ github.token }}

# remove local workspaces; remove all files in the environment
- uses: AutoModality/action-clean@v1

# checkout deploy/run
- uses: actions/checkout@v2
with:
ref: deploy/run
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

# update npm and composer packages
- name: Install or update dependencies; Create local changes
run: |
composer update --no-dev --optimize-autoloader
composer dump-autoload -o
npm install && npm run prod
# see changed files
- name: See the status of git
run: git status

# list files
- name: List files in the repository
run: |
ls -l ${{ github.workspace }}
# commit changes to deploy/run branch
- name: Commit changed files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "merge and deploy workflow" -a
# push changes to origin deploy/run
- name: Push changes to deploy/run
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: deploy/run

# SSH commands to access production server
- name: Do some shells in the production server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOSTINGER_SSH_HOST }}
username: ${{ secrets.HOSTINGER_USERNAME }}
password: ${{ secrets.HOSTINGER_FTP_PASSWORD }}
port: ${{ secrets.HOSTINGER_SSH_PORT }}
script: |
bash .0IMPORTANT/github-actions/deployer-main.sh
90 changes: 90 additions & 0 deletions .github/workflows/mergeStage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Merge and Stage
on:
push:
branches:
- staging
jobs:
merge-and-stage:
runs-on: ubuntu-latest
steps:
# merge this branch to deploy/ztemplate-staging
- uses: actions/checkout@master
- name: Merge ${{ github.ref }} > deploy/ztemplate-staging
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: ${{ github.ref }}
target_branch: deploy/ztemplate-staging
github_token: ${{ github.token }}

# remove local workspaces; remove all files in the environment
- uses: AutoModality/action-clean@v1

# checkout deploy/ztemplate-staging
- uses: actions/checkout@v2
with:
ref: deploy/ztemplate-staging
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

# merge deploy/ztemplate-staging to deploy/staging
- uses: actions/checkout@master
- name: Merge deploy/ztemplate-staging > deploy/staging
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: ${{ github.ref }}
target_branch: deploy/staging
github_token: ${{ github.token }}

# remove local workspaces; remove all files in the environment
- uses: AutoModality/action-clean@v1

# checkout deploy/staging
- uses: actions/checkout@v2
with:
ref: deploy/staging
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

# update npm and composer packages
- name: Install or update dependencies; Create local changes
run: |
composer update --no-dev --optimize-autoloader
composer dump-autoload -o
npm install && npm run prod
# see changed files
- name: See the status of git
run: git status

# list files
- name: List files in the repository
run: |
ls -l ${{ github.workspace }}
# commit changes to deploy/staging branch
- name: Commit changed files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "merge and deploy workflow" -a
# push changes to origin deploy/staging
- name: Push changes to deploy/staging
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: deploy/staging

# SSH commands to access production server
- name: Do some shells in the production server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOSTINGER_SSH_HOST }}
username: ${{ secrets.HOSTINGER_USERNAME }}
password: ${{ secrets.HOSTINGER_FTP_PASSWORD }}
port: ${{ secrets.HOSTINGER_SSH_PORT }}
script: |
bash .0IMPORTANT/github-actions/deployer-staging.sh
49 changes: 30 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# Vendor packages
*/vendor/*
composer.lock
node_modules/
npm-debug.log
package-lock.json
vendor/
yarn-error.log
# apache configuration file
.htaccess

# Laravel 4 specific
bootstrap/compiled.php
app/storage/

# Laravel 5 & Lumen specific
public/storage
# public/storage
public/hot

# Laravel 5 & Lumen specific with changed public path
Expand All @@ -29,19 +23,36 @@ Homestead.json
/.vagrant
.phpunit.result.cache

# webpack compiled files
public/css/app.css
public/js/app.js
public/js/app.js.LICENSE.txt
public/css/about.css
public/css/promo.css
public/css/contact.css

# miscelanous
_todo/*
public/mix-manifest.json

# storage link
public/storage
public/js/promo.js
public/js/promo.js.LICENSE.txt

# Vendor packages
*/vendor/*
composer.lock
node_modules/
npm-debug.log
package-lock.json
vendor/
yarn-error.log

# webpack compiled files
# js compiled files
!public/js/
public/js/*
!public/js/algorithm
!public/js/mashiro
!public/js/admin/
public/js/admin/*
!public/js/admin/.directory
# css compiled files
!public/css/
public/css/*
!public/css/algorithm
!public/css/mashiro
!public/css/admin/
public/css/admin/*
!public/css/admin/.directory
2 changes: 1 addition & 1 deletion app/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
class Book extends Model
{
protected $fillable = [
'name', 'phone', 'email', 'events', 'booking_date', 'location', 'note'
'name', 'phone', 'email', 'events', 'booking_date', 'location', 'note', 'status'
];
}
13 changes: 13 additions & 0 deletions app/Books_package.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Books_package extends Model
{
public $timestamps = false;
protected $primaryKey = 'id';
public $incrementing = false;
protected $keyType = 'string';
}
16 changes: 16 additions & 0 deletions app/DisplayedPromo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class DisplayedPromo extends Model
{
protected $fillable = ['promo_id'];
public $timestamps = false;

public function promo()
{
return $this->belongsTo(Promo::class);
}
}
15 changes: 15 additions & 0 deletions app/Displayed_feedback.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Displayed_feedback extends Model
{
protected $guarded = [];

public function feedback()
{
return $this->belongsTo(Feedback::class);
}
}
3 changes: 2 additions & 1 deletion app/Feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

class Feedback extends Model
{
protected $table = 'feedbacks';
protected $fillable = [
'mempelai_pria', 'mempelai_wanita', 'kesan_pesan', 'kritik_saran'
'mempelai_pria', 'mempelai_wanita', 'kesan_pesan', 'kritik_saran'
];
}
Loading

0 comments on commit c2642d0

Please sign in to comment.