Skip to content

Commit

Permalink
MNG-73 Add workflow for gh-pages (#2)
Browse files Browse the repository at this point in the history
Should work on master as Ola added package.json in different task.
  • Loading branch information
daria305 authored Jan 25, 2021
1 parent 04ce016 commit 42b9376
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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: Node.js CI

on:
push:
paths-ignore:
- '**/*.md'

jobs:
build:
name: "Build Pokemon Fight application"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 14.x
- run: npm ci
- run: npm run build --if-present
- run: npm test
- uses: actions/upload-artifact@v1
name: Upload build as artifact
if: always()
with:
name: pokefight-dist
path: ./dist
deploy-on-github-pages:
name: "Deploy app to GitHub Pages from master branch source code"
if: github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: pokefight-dist
path: ./dist
- name: Deploy app as GitHub Pages
uses: peaceiris/actions-gh-pages@v3.7.0-6
if: ${{ github.event_name != 'pull_request' && always() }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: "./dist"
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
force_orphan: true
keep_files: false

0 comments on commit 42b9376

Please sign in to comment.