Skip to content

Instantly share code, notes, and snippets.

@plencovich
Last active March 17, 2021 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plencovich/d86343b2697e94db07c8ef210971f064 to your computer and use it in GitHub Desktop.
Save plencovich/d86343b2697e94db07c8ef210971f064 to your computer and use it in GitHub Desktop.
archivos de ejemmplo
name: deploy-production
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: ./private_html/vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Get npm cache directory
uses: actions/cache@v2
with:
path: |
~/cache
!~/cache/exclude
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Install Composer dependencies
working-directory: ./private_html
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-scripts --ignore-platform-reqs --no-progress --optimize-autoloader --no-interaction
- name: Install NPM dependencies
run: npm install --silent
- name: Compile assets
run: npm run production
- name: Deploy with rsync
env:
my_ssh_key: ${{ secrets.SSH_KEY }}
run: |
mkdir ~/.ssh
echo "$my_ssh_key" > ~/.ssh/gh_actions_key
chmod 600 ~/.ssh/gh_actions_key
rsync -avuh --delete --progress -h -e "ssh -i ~/.ssh/gh_actions_key -o StrictHostKeyChecking=no" --no-perms --no-owner --no-group --no-times --exclude-from "exclude.txt" --rsync-path="rsync" ${GITHUB_WORKSPACE}/ ${{ secrets.PROD_USER }}@${{secrets.PROD_HOST}}:${{secrets.PROD_FOLDER}}
{
"name": "wmscp",
"version": "1.0.0",
"description": "Web Managment System in the Cloud by Plen.co",
"scripts": {
"dev": "npm run clean-assets && npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run clean-assets && npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"composer": "cd private_html && composer update && cd ..",
"clean-assets": "rm -fR public_html/assets/*"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/plencovich/wmscp.git"
},
"author": "Diego Plenco - Plen.co",
"license": "MIT",
"homepage": "https://github.com/plencovich/wmscp#readme",
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.14.0",
"animate.css": "^4.1.0",
"bootstrap": "^4.5.2",
"clipboard": "^2.0.6",
"croppie": "^2.6.5",
"cross-env": "^7.0.2",
"datatables.net-bs4": "^1.10.21",
"datatables.net-buttons-bs4": "^1.6.3",
"datatables.net-responsive-bs4": "^2.2.5",
"dropzone": "^5.7.2",
"icheck": "^1.0.2",
"jasny-bootstrap": "^4.0.0",
"jquery": "^3.5.1",
"jquery-mask-plugin": "^1.14.16",
"jquery-slimscroll": "^1.3.8",
"jszip": "^3.5.0",
"laravel-mix": "^5.0.4",
"metismenu": "^2.7.9",
"pace-js": "^1.0.2",
"pdfmake": "^0.1.68",
"popper.js": "^1.16.1",
"select2": "^4.0.13",
"summernote": "^0.8.18",
"sweetalert2": "^9.17.1",
"vue-template-compiler": "^2.6.11"
},
"dependencies": {}
}
let mix = require('laravel-mix');
mix.setPublicPath('./httpdocs/');
/* JS Backoffice */
mix.combine([
'node_modules/jquery/dist/jquery.js',
'node_modules/popper.js/dist/umd/popper.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/pace-js/pace.js',
'node_modules/metismenu/dist/metisMenu.js',
'node_modules/jquery-slimscroll/jquery.slimscroll.js',
'node_modules/sweetalert2/dist/sweetalert2.all.js',
'node_modules/jszip/dist/jszip.js',
'node_modules/pdfmake/build/pdfmake.js',
'node_modules/pdfmake/build/vfs_fonts.js',
'node_modules/datatables.net/js/jquery.dataTables.js',
'node_modules/datatables.net-bs4/js/dataTables.bootstrap4.js',
'node_modules/datatables.net-buttons/js/dataTables.buttons.js',
'node_modules/datatables.net-buttons/js/buttons.colVis.js',
'node_modules/datatables.net-buttons/js/buttons.html5.js',
'node_modules/datatables.net-buttons/js/buttons.print.js',
'node_modules/datatables.net-buttons-bs4/js/buttons.bootstrap4.js',
'node_modules/datatables.net-responsive/js/dataTables.responsive.js',
'node_modules/datatables.net-responsive-bs4/js/responsive.bootstrap4.js',
'node_modules/jasny-bootstrap/js/fileinput.js',
'node_modules/croppie/croppie.js',
'resources/backoffice/js/init.croppie.js',
'node_modules/dropzone/dist/dropzone.js',
'resources/backoffice/js/init.dropzone.js',
'node_modules/icheck/icheck.js',
'node_modules/select2/dist/js/select2.js',
'node_modules/select2/dist/js/i18n/es.js',
'node_modules/clipboard/dist/clipboard.js',
'resources/backoffice/plugins/datedropper/js/datedropper.js',
'node_modules/summernote/dist/summernote-bs4.js',
'node_modules/summernote/dist/lang/summernote-es-ES.js',
'node_modules/jquery-mask-plugin/dist/jquery.mask.js',
'resources/backoffice/js/swal.custom.js',
'resources/backoffice/js/form.submit.js',
'resources/backoffice/js/form.moderate.js',
'resources/backoffice/js/form.delete.js',
'resources/backoffice/js/form.edit.item.js',
'resources/backoffice/js/modal.picture.js',
'resources/backoffice/js/orders.list.js',
'resources/backoffice/js/mask_input.js',
'resources/backoffice/js/main.js'
], 'httpdocs/assets/js/bundle.backoffice.js');
/* CSS Backoffice */
mix.combine([
'node_modules/bootstrap/dist/css/bootstrap.css',
'node_modules/@fortawesome/fontawesome-free/css/all.css',
'node_modules/animate.css/animate.css',
'node_modules/metismenu/dist/metisMenu.css',
'node_modules/sweetalert2/dist/sweetalert2.css',
'node_modules/datatables.net-bs4/css/dataTables.bootstrap4.css',
'node_modules/datatables.net-buttons-bs4/css/buttons.bootstrap4.css',
'node_modules/datatables.net-responsive-bs4/css/responsive.bootstrap4.css',
'node_modules/jasny-bootstrap/dist/css/jasny-bootstrap.css',
'node_modules/croppie/croppie.css',
'node_modules/dropzone/dist/basic.css',
'node_modules/dropzone/dist/dropzone.css',
'node_modules/icheck/skins/flat/grey.css',
'node_modules/select2/dist/css/select2.css',
'resources/backoffice/plugins/select2/bs4.css',
'resources/backoffice/plugins/datedropper/css/datedropper.css',
'node_modules/summernote/dist/summernote-bs4.css',
'resources/backoffice/css/backoffice.css',
'resources/backoffice/css/custom.css'
], 'httpdocs/assets/css/bundle.backoffice.css');
/* CSS Frontend */
mix.combine([
'resources/maqueta/css/bootstrap.css',
'resources/maqueta/css/fontawesome-all.css',
'resources/maqueta/css/swiper.css',
'resources/maqueta/css/magnific-popup.css',
'resources/maqueta/css/styles.css',
'resources/maqueta/css/styles-custom.css',
'resources/maqueta/css/aos.css',
'node_modules/sweetalert2/dist/sweetalert2.css',
'resources/frontend/css/custom.css',
], 'httpdocs/assets/css/bundle.css');
/* JS Frontend */
mix.combine([
'node_modules/jquery/dist/jquery.js',
'node_modules/popper.js/dist/umd/popper.js',
'resources/maqueta/js/bootstrap.min.js',
'resources/maqueta/js/jquery.easing.min.js',
'resources/maqueta/js/swiper.min.js',
'resources/maqueta/js/jquery.magnific-popup.js',
'resources/maqueta/js/scripts.js',
'resources/maqueta/js/aos.js',
'resources/maqueta/js/main.js',
'node_modules/sweetalert2/dist/sweetalert2.all.js',
'resources/frontend/js/swal.custom.js',
'resources/frontend/js/form.submit.js',
'resources/frontend/js/payment.js',
], 'httpdocs/assets/js/bundle.js');
/* JS Account */
mix.combine([
'node_modules/jquery/dist/jquery.js',
'node_modules/popper.js/dist/umd/popper.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/pace-js/pace.js',
'node_modules/metismenu/dist/metisMenu.js',
'node_modules/jquery-slimscroll/jquery.slimscroll.js',
'node_modules/sweetalert2/dist/sweetalert2.all.js',
'node_modules/jszip/dist/jszip.js',
'node_modules/pdfmake/build/pdfmake.js',
'node_modules/pdfmake/build/vfs_fonts.js',
'node_modules/datatables.net/js/jquery.dataTables.js',
'node_modules/datatables.net-bs4/js/dataTables.bootstrap4.js',
'node_modules/datatables.net-buttons/js/dataTables.buttons.js',
'node_modules/datatables.net-buttons/js/buttons.colVis.js',
'node_modules/datatables.net-buttons/js/buttons.html5.js',
'node_modules/datatables.net-buttons/js/buttons.print.js',
'node_modules/datatables.net-buttons-bs4/js/buttons.bootstrap4.js',
'node_modules/datatables.net-responsive/js/dataTables.responsive.js',
'node_modules/datatables.net-responsive-bs4/js/responsive.bootstrap4.js',
'node_modules/jasny-bootstrap/js/fileinput.js',
'node_modules/croppie/croppie.js',
'resources/backoffice/js/init.croppie.js',
'node_modules/dropzone/dist/dropzone.js',
'resources/backoffice/js/init.dropzone.js',
'node_modules/icheck/icheck.js',
'node_modules/select2/dist/js/select2.js',
'node_modules/select2/dist/js/i18n/es.js',
'node_modules/clipboard/dist/clipboard.js',
'resources/backoffice/plugins/datedropper/js/datedropper.js',
'node_modules/jquery-mask-plugin/dist/jquery.mask.js',
'resources/backoffice/js/swal.custom.js',
'resources/backoffice/js/mask_input.js',
'resources/account/js/form.edit.item.js',
'resources/account/js/form.delete.js',
'resources/account/js/form.submit.js',
'resources/account/js/modal.picture.js',
'resources/backoffice/js/main.js'
], 'httpdocs/assets/js/bundle.account.js');
/* CSS Account */
mix.combine([
'node_modules/bootstrap/dist/css/bootstrap.css',
'node_modules/@fortawesome/fontawesome-free/css/all.css',
'node_modules/animate.css/animate.css',
'node_modules/metismenu/dist/metisMenu.css',
'node_modules/sweetalert2/dist/sweetalert2.css',
'node_modules/datatables.net-bs4/css/dataTables.bootstrap4.css',
'node_modules/datatables.net-buttons-bs4/css/buttons.bootstrap4.css',
'node_modules/datatables.net-responsive-bs4/css/responsive.bootstrap4.css',
'node_modules/icheck/skins/flat/grey.css',
'node_modules/select2/dist/css/select2.css',
'resources/backoffice/plugins/select2/bs4.css',
'resources/backoffice/plugins/datedropper/css/datedropper.css',
'resources/backoffice/css/backoffice.css',
'resources/backoffice/css/custom.css'
], 'httpdocs/assets/css/bundle.account.css');
/* CSS Maintenance - BASIC */
mix.combine([
'node_modules/bootstrap/dist/css/bootstrap.css',
'node_modules/@fortawesome/fontawesome-free/css/all.css',
'resources/maintenance/version_basic/assets/css/style.css',
'resources/maintenance/version_basic/assets/css/responsive.css'
], 'httpdocs/assets/css/welcome-basic.css');
/* JS Maintenance - BASIC */
mix.combine([
'node_modules/jquery/dist/jquery.js',
'node_modules/popper.js/dist/umd/popper.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'resources/maintenance/version_basic/assets/js/main.js'
], 'httpdocs/assets/js/welcome-basic.js');
/* CSS Maintenance - CONTACT */
mix.combine([
'node_modules/bootstrap/dist/css/bootstrap.css',
'node_modules/@fortawesome/fontawesome-free/css/all.css',
'resources/maintenance/version_contact/assets/css/style.css',
'node_modules/sweetalert2/dist/sweetalert2.css',
'resources/maintenance/version_contact/assets/css/custom.css',
], 'httpdocs/assets/css/welcome-contact.css');
/* JS Maintenance - CONTACT */
mix.combine([
'node_modules/jquery/dist/jquery.js',
'node_modules/popper.js/dist/umd/popper.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/sweetalert2/dist/sweetalert2.all.js',
'resources/maintenance/version_contact/assets/js/main.js'
], 'httpdocs/assets/js/welcome-contact.js');
mix.sourceMaps();
/* MIX Version */
mix.version();
/* Copy Assets */
mix.copyDirectory('node_modules/@fortawesome/fontawesome-free/webfonts', 'httpdocs/assets/webfonts')
mix.copyDirectory('resources/backoffice/plugins/datedropper/fonts', 'httpdocs/assets/fonts')
mix.copyDirectory('node_modules/summernote/dist/font', 'httpdocs/assets/css/font')
mix.copy('node_modules/icheck/skins/flat/grey.png', 'httpdocs/assets/css/')
mix.copy('node_modules/icheck/skins/flat/grey@2x.png', 'httpdocs/assets/css/')
mix.copy('resources/backoffice/js/dataTables.lang.es.json', 'httpdocs/assets/js/datatables-esp.json')
mix.copy('resources/backoffice/images', 'httpdocs/assets/images')
mix.copy('resources/maintenance/img', 'httpdocs/assets/images')
mix.copy('resources/graphics/stock', 'httpdocs/assets/images')
mix.copy('resources/maqueta/images', 'httpdocs/assets/images')
mix.copy('resources/maqueta/webfonts/Play*', 'httpdocs/assets/webfonts')
/* MIX Options */
mix.options({
processCssUrls: true,
cleanCss: {
level: {
1: {
specialComments: 'none'
}
}
},
postCss: [
require('postcss-discard-comments')({
removeAll: true
})
]
});
mix.disableNotifications();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment