diff --git a/.github/workflows/publish-gh-pages.yml b/.github/workflows/publish-gh-pages.yml new file mode 100644 index 0000000..99946c0 --- /dev/null +++ b/.github/workflows/publish-gh-pages.yml @@ -0,0 +1,22 @@ +name: Build and Deploy +on: [push] +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. + with: + persist-credentials: false + + - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. + run: | + npm install + npm run build + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: dist/deploy # The folder the action should deploy. diff --git a/.github/workflows/scheduled-merge.yml b/.github/workflows/scheduled-merge.yml new file mode 100644 index 0000000..36e8a7e --- /dev/null +++ b/.github/workflows/scheduled-merge.yml @@ -0,0 +1,34 @@ +name: Merge upstream branches every Thursday 00:00 +on: + schedule: + - cron: '0 4,8,12,16 * * 3' + - cron: '0 0,8,16 * * 4' + workflow_dispatch: + +jobs: + merge: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + token: ${{secrets.GHPAGE_SECRET}} + - name: Merge upstream + run: | + git config --global user.name 'GitHub Action by Anthony' + git config --global user.email 'anthonychwong@live.com' + + # "git checkout master" is unnecessary, already here by default + git pull --unshallow # this option is very important, you would get + # complains about unrelated histories without it. + # (but actions/checkout@v2 can also be instructed + # to fetch all git depth right from the start) + + git remote set-url origin https://${{secrets.GHPAGE_SECRET}}@github.com/anthonychwong/gbgwcalculator + + git remote add upstream https://github.com/rmkane/gbgwcalculator.github.io.git + git fetch upstream + + git checkout master + git merge --no-edit upstream/master + git push origin master diff --git a/Gruntfile.js b/Gruntfile.js index 2f41493..6430886 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function (grunt) { meta: { src: 'src', - dest: 'dist', + dest: 'dist/deploy', banner: '/*\n <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> \n*/' }, @@ -23,7 +23,7 @@ module.exports = function (grunt) { sourceMap : true }, dev: { - files: {'<%= meta.dest %>/js/bundle.js': '<%= meta.src %>/js/**/*.js'}, + files: {'<%= meta.dest %>/dist/js/bundle.js': '<%= meta.src %>/js/**/*.js'}, options: { beautify: true, mangle: false, @@ -33,7 +33,7 @@ module.exports = function (grunt) { }, prod: { files: { - '<%= meta.dest %>/js/bundle.min.js': [ + '<%= meta.dest %>/dist/js/bundle.min.js': [ '<%= meta.src %>/js/data.js', '<%= meta.src %>/js/globals.js', '<%= meta.src %>/js/data-store.class.js', @@ -49,7 +49,7 @@ module.exports = function (grunt) { less: { build: { files: { - '<%= meta.dest %>/css/bundle.css': [ + '<%= meta.dest %>/dist/css/bundle.css': [ '<%= meta.src %>/css/gbgw-icons.css', '<%= meta.src %>/css/style.css', '<%= meta.src %>/css/themes/dark.css' @@ -64,7 +64,7 @@ module.exports = function (grunt) { }, build: { files: { - '<%= meta.dest %>/css/bundle.min.css': [ + '<%= meta.dest %>/dist/css/bundle.min.css': [ '<%= meta.src %>/css/gbgw-icons.css', '<%= meta.src %>/css/style.css', '<%= meta.src %>/css/themes/dark.css' @@ -80,25 +80,28 @@ module.exports = function (grunt) { cwd: '<%= meta.src %>/data', src: '**/*.json', flatten: true, - dest: '<%= meta.dest %>/data', + dest: '<%= meta.dest %>/dist/data', },{ expand: true, cwd: '<%= meta.src %>/assets/icons', src: '**/*.png', flatten: true, - dest: '<%= meta.dest %>/assets', + dest: '<%= meta.dest %>/dist/assets', }, { expand: true, cwd: '<%= meta.src %>/assets/third-party', src: [ '**/*.svg', '**/*.jpg' ], flatten: true, - dest: '<%= meta.dest %>/assets', + dest: '<%= meta.dest %>/dist/assets', }, { expand: true, cwd: '<%= meta.src %>/css/fonts', src: '*', flatten: true, - dest: '<%= meta.dest %>/css/fonts', + dest: '<%= meta.dest %>/dist/css/fonts', + }, { + src: '<%= meta.src %>/../index.html', + dest: '<%= meta.dest %>/index.html', }] } }, diff --git a/README.md b/README.md index 1943efe..ed432fd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![Build and Deploy](https://github.com/anthonychwong/gbgwcalculator/workflows/Build%20and%20Deploy/badge.svg) + # GBGW Calculator ## About @@ -32,4 +34,4 @@ For version history, please view the [change log](./CHANGELOG.md). * [AutoRiceCooker @ GitHub](https://github.com/autoricecooker) * [Acylos @ Reddit](https://www.reddit.com/user/Acylos) * [SmilyT1 @ GamePress](https://gamepress.gg/user/684586) -* And many others @ [GBGW: Newtype Labs](https://discord.gg/6aMUnBD) \ No newline at end of file +* And many others @ [GBGW: Newtype Labs](https://discord.gg/6aMUnBD) diff --git a/index.html b/index.html index 89ca7a8..d4256e0 100644 --- a/index.html +++ b/index.html @@ -69,6 +69,10 @@

GBGW Calculator v1.3.0

+
+

Share selected parts and gear

+ +