diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml new file mode 100644 index 000000000..f6763b2ca --- /dev/null +++ b/.github/workflows/github-action.yml @@ -0,0 +1,38 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Adapt Framework deployment + +on: + push: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: npm install + - name: Install cli tools + run: npm install -g grunt-cli adapt-cli + - name: Install adapt plugins + run: adapt install + - name: Generate build + run: grunt build + - name: Deploy build + run: | + git config --global user.name ${{secrets.USERNAME}} + git config --global user.email ${{secrets.EMAIL}} + git remote set-url origin https://${{secrets.ACCESS_TOKEN}}@github.com/${{secrets.USERNAME}}/adapt_framework.git + npm run deploy diff --git a/package.json b/package.json index d125b7d25..3b88dcc13 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "url": "git://github.com/adaptlearning/adapt_framework.git" }, "scripts": { - "lint": "node node_modules/eslint/bin/eslint.js ./" + "lint": "node node_modules/eslint/bin/eslint.js ./", + "deploy": "gh-pages -d build" }, "authoringTool": ">=0.8", "license": "GPL-3.0", @@ -60,6 +61,7 @@ "eslint-plugin-node": "^9.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-requirejs": "^4.0.0", - "eslint-plugin-standard": "^4.0.0" + "eslint-plugin-standard": "^4.0.0", + "gh-pages": "^1.2.0" } }