-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fa7b432
Showing
31 changed files
with
4,400 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Publish Website | ||
|
||
on: | ||
push: | ||
branches: | ||
- trunk | ||
workflow_dispatch: | ||
jobs: | ||
Build-Artifact-Action: | ||
name: Build-Artifact-Action | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: Install PHP dependencies for production | ||
uses: php-actions/composer@v6 | ||
with: | ||
php_version: 8.1 | ||
args: '--optimize-autoloader --no-dev --profile --ignore-platform-reqs --no-interaction --no-progress --prefer-dist' | ||
|
||
- name: Setup node 20 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Run yarn install | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install | ||
|
||
- name: Run yarn grunt | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: grunt | ||
|
||
- name: Upload the artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wpcom | ||
path: | | ||
. | ||
!.DS_Store | ||
!.git | ||
!.gitattributes | ||
!.github | ||
!.gitignore | ||
!.editorconfig.json | ||
!README.md | ||
!composer.lock | ||
!package-lock.json | ||
!package.json | ||
!travis.yml | ||
!phpcs.xml.dist | ||
!node_modules | ||
!yarn.lock |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
language: php | ||
|
||
matrix: | ||
include: | ||
- php: '7.2' | ||
env: SNIFF=1 | ||
- php: '7.1' | ||
env: SNIFF=1 | ||
allow_failures: | ||
- php: '5.6' | ||
env: SNIFF=1 | ||
- php: '7.0' | ||
env: SNIFF=1 | ||
- php: 'nightly' | ||
env: SNIFF=1 | ||
|
||
before_install: | ||
- if [[ "$SNIFF" == "1" ]]; then export PHPCS_DIR=$PWD/vendor/bin; fi | ||
- if [[ "$SNIFF" == "1" ]]; then export SNIFFS_DIR=$PWD/vendor/wp-coding-standards/wpcs; fi | ||
- composer install | ||
- composer update | ||
- ./vendor/bin/phpcs --config-set installed_paths $SNIFFS_DIR | ||
- ./vendor/bin/phpcs -i | ||
- if [[ "$SNIFF" == "1" ]]; then ./vendor/bin/phpcs --config-set installed_paths $SNIFFS_DIR; fi | ||
|
||
script: | ||
- export SNIFFS_IGNORE=*/node/*,*/vendor/*,*Gruntfile.js*,*.min.js*,*.min.css*,*.less* | ||
- if [[ "$SNIFF" == "1" ]]; then ./vendor/bin/phpcs -p . --standard=WordPress --ignore=$SNIFFS_IGNORE; fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* jshint node:true */ | ||
module.exports = function( grunt ){ | ||
'use strict'; | ||
|
||
grunt.initConfig({ | ||
// setting folder templates | ||
dirs: { | ||
css: 'assets/css', | ||
less: 'assets/css', | ||
js: 'assets/js' | ||
}, | ||
|
||
// Compile all .less files. | ||
less: { | ||
compile: { | ||
options: { | ||
// These paths are searched for @imports | ||
paths: ['<%= less.css %>/'] | ||
}, | ||
files: [{ | ||
expand: true, | ||
cwd: '<%= dirs.css %>/', | ||
src: [ | ||
'*.less', | ||
'!mixins.less' | ||
], | ||
dest: '<%= dirs.css %>/', | ||
ext: '.css' | ||
}] | ||
} | ||
}, | ||
|
||
// Minify all .css files. | ||
cssmin: { | ||
minify: { | ||
expand: true, | ||
cwd: '<%= dirs.css %>/', | ||
src: ['*.css'], | ||
dest: '<%= dirs.css %>/', | ||
ext: '.css' | ||
} | ||
}, | ||
|
||
// Minify .js files. | ||
uglify: { | ||
options: { | ||
preserveComments: 'some' | ||
}, | ||
jsfiles: { | ||
files: [{ | ||
expand: true, | ||
cwd: '<%= dirs.js %>/', | ||
src: [ | ||
'*.js', | ||
'!*.min.js', | ||
'!Gruntfile.js', | ||
], | ||
dest: '<%= dirs.js %>/', | ||
ext: '.min.js' | ||
}] | ||
} | ||
}, | ||
|
||
// Watch changes for assets | ||
watch: { | ||
less: { | ||
files: [ | ||
'<%= dirs.less %>/*.less', | ||
], | ||
tasks: ['less', 'cssmin'], | ||
}, | ||
js: { | ||
files: [ | ||
'<%= dirs.js %>/*js', | ||
'!<%= dirs.js %>/*.min.js' | ||
], | ||
tasks: ['uglify'] | ||
} | ||
}, | ||
|
||
}); | ||
|
||
// Load NPM tasks to be used here | ||
grunt.loadNpmTasks( 'grunt-contrib-less' ); | ||
grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); | ||
grunt.loadNpmTasks( 'grunt-contrib-uglify' ); | ||
grunt.loadNpmTasks( 'grunt-contrib-watch' ); | ||
|
||
// Register tasks | ||
grunt.registerTask( 'default', [ | ||
'less', | ||
'cssmin', | ||
'uglify' | ||
]); | ||
|
||
}; |
Oops, something went wrong.