Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
katinthehatsite committed Mar 1, 2024
0 parents commit fa7b432
Show file tree
Hide file tree
Showing 31 changed files with 4,400 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/dotcom-build-artifact.yml
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
28 changes: 28 additions & 0 deletions .travis.yml
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
96 changes: 96 additions & 0 deletions Gruntfile.js
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'
]);

};
Loading

0 comments on commit fa7b432

Please sign in to comment.